fix TestReactorCreatesBlockWhenEmptyBlocksFalse

by checking if we have LastCommit or not
This commit is contained in:
Anton Kaliaev 2019-09-05 12:53:06 +04:00
parent aea2fb7a75
commit 0314ff2605
No known key found for this signature in database
GPG Key ID: 7B6881D965918214

View File

@ -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)