From ca24926f28242ee6813dbfea7a5ca9050e62f48d Mon Sep 17 00:00:00 2001 From: frozen <355847+Frozen@users.noreply.github.com> Date: Fri, 20 Dec 2024 19:59:03 -0400 Subject: [PATCH] Fix set view ids. --- consensus/consensus_v2.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index 9227a3a4b2..511a3405fa 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -398,7 +398,9 @@ func (consensus *Consensus) syncReadyChan(reason string) { func (consensus *Consensus) syncNotReadyChan(reason string) { mode := consensus.current.Mode() - consensus.setBlockNum(consensus.Blockchain().CurrentHeader().Number().Uint64() + 1) + header := consensus.Blockchain().CurrentHeader() + consensus.setBlockNum(header.Number().Uint64() + 1) + consensus.setViewIDs(header.ViewID().Uint64() + 1) consensus.current.SetMode(Syncing) consensus.getLogger().Info().Msgf("[ConsensusMainLoop] syncNotReadyChan, prev %s, reason %s", mode.String(), reason) consensus.getLogger().Info().Msgf("[ConsensusMainLoop] Node is OUT OF SYNC, reason: %s", reason)