Skip to content

Commit

Permalink
fix: send decided vote for past round
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad committed Dec 10, 2024
1 parent c7ab5d8 commit 0038a6b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,12 @@ 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)
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 0038a6b

Please sign in to comment.