From b87f90e5dd2216ca19c6597145ba246addb15f71 Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Sat, 7 Nov 2020 15:40:47 -0800 Subject: [PATCH] fix finality count for leader --- consensus/consensus_v2.go | 2 ++ node/node_newblock.go | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index f9a5dc910..2bb3793d8 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -343,6 +343,8 @@ func (consensus *Consensus) Start( // Sleep to wait for the full block time consensus.getLogger().Info().Msg("[ConsensusMainLoop] Waiting for Block Time") <-time.After(time.Until(consensus.NextBlockDue)) + consensus.StartFinalityCount() + // Update time due for next block consensus.NextBlockDue = time.Now().Add(consensus.BlockPeriod) diff --git a/node/node_newblock.go b/node/node_newblock.go index e8f8698d9..ef9fd35f2 100644 --- a/node/node_newblock.go +++ b/node/node_newblock.go @@ -80,7 +80,6 @@ func (node *Node) WaitForConsensusReadyV2(readySignal chan consensus.ProposalTyp } } }() - node.Consensus.StartFinalityCount() newBlock, err := node.ProposeNewBlock(newCommitSigsChan) if err == nil {