From 5ee737aa52d1e52c85a7c7ddd3d7922c0444f20f Mon Sep 17 00:00:00 2001 From: mantre Date: Tue, 3 Oct 2023 01:05:37 +0800 Subject: [PATCH] fix: send query votes message, if there is no proposal yet --- consensus/consensus.go | 5 +++++ consensus/prepare.go | 1 + 2 files changed, 6 insertions(+) diff --git a/consensus/consensus.go b/consensus/consensus.go index 4a522342d..a577c611e 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -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(), diff --git a/consensus/prepare.go b/consensus/prepare.go index 31a270d85..34324195d 100644 --- a/consensus/prepare.go +++ b/consensus/prepare.go @@ -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()