Skip to content

Commit

Permalink
fix(consensus): send decided vote for past round
Browse files Browse the repository at this point in the history
  • Loading branch information
themantre committed Nov 30, 2024
1 parent 8ad18ad commit 66b7953
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 66b7953

Please sign in to comment.