Skip to content

Commit

Permalink
fix: send query votes message, if there is no proposal yet
Browse files Browse the repository at this point in the history
  • Loading branch information
themantre committed Oct 2, 2023
1 parent 6b66ab0 commit 5ee737a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,11 @@ func (cs *consensus) queryProposal() {
message.NewQueryProposalMessage(cs.height, cs.round))
}

func (cs *consensus) queryVotes() {
cs.broadcaster(cs.valKey.Address(),
message.NewQueryVotesMessage(cs.height, cs.round))
}

func (cs *consensus) broadcastProposal(p *proposal.Proposal) {
go cs.mediator.OnPublishProposal(cs, p)
cs.broadcaster(cs.valKey.Address(),
Expand Down
1 change: 1 addition & 0 deletions consensus/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (s *prepareState) onTimeout(t *ticker) {
roundProposal := s.log.RoundProposal(s.round)
if roundProposal == nil {
s.queryProposal()
s.queryVotes()
}
} else if t.Target == tickerTargetChangeProposer {
s.startChangingProposer()
Expand Down

0 comments on commit 5ee737a

Please sign in to comment.