consensus/network: reinit dbft after block addition

Don't stall on some height if everyone else have moved up already. Fix #673.
This commit is contained in:
Roman Khimov 2020-02-17 16:20:04 +03:00
parent c5d54e9992
commit 37c48b00b4
2 changed files with 32 additions and 9 deletions

View file

@ -99,7 +99,11 @@ func NewServer(config ServerConfig, chain core.Blockchainer, log *zap.Logger) (*
log: log,
}
s.bQueue = newBlockQueue(maxBlockBatch, chain, log, func(b *block.Block) {
s.tryStartConsensus()
if s.consensusStarted.Load() {
s.consensus.OnNewBlock()
} else {
s.tryStartConsensus()
}
s.relayBlock(b)
})