From 0314ff26058daa38f585d208f480c52e617ef6f5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 5 Sep 2019 12:53:06 +0400 Subject: [PATCH] fix TestReactorCreatesBlockWhenEmptyBlocksFalse by checking if we have LastCommit or not --- consensus/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/state.go b/consensus/state.go index c8c2f96b..c26f96af 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -757,7 +757,7 @@ func (cs *ConsensusState) handleTxsAvailable() { cs.mtx.Lock() defer cs.mtx.Unlock() - if cs.config.SkipTimeoutCommit && cs.LastCommit.HasAll() { + if cs.config.SkipTimeoutCommit && cs.LastCommit != nil && cs.LastCommit.HasAll() { // we only need to do this for round 0 cs.enterNewRound(cs.Height, 0) cs.enterPropose(cs.Height, 0)