From 66b7953a5e148d34ca40fd8fa9e70d4117f65cf6 Mon Sep 17 00:00:00 2001 From: mantre Date: Sat, 30 Nov 2024 12:46:33 +0800 Subject: [PATCH] fix(consensus): send decided vote for past round --- consensus/consensus.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/consensus/consensus.go b/consensus/consensus.go index cd30fc8fe..13f2023b3 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -508,14 +508,13 @@ func (cs *consensus) HandleQueryVote(height uint32, round int16) *vote.Vote { votes := []*vote.Vote{} switch { case round < cs.round: - // A validator requests votes for past rounds. - // Sending cp:decide for the last round helps them advance to the current round. - vs := cs.log.CPDecidedVoteSet(cs.round - 1) + // Past round: Only broadcast cp:decided votes + vs := cs.log.CPDecidedVoteSet(round) votes = append(votes, vs.AllVotes()...) case round == cs.round: // Current round - m := cs.log.RoundMessages(cs.round) + m := cs.log.RoundMessages(round) votes = append(votes, m.AllVotes()...) case round > cs.round: