From bbea88d9b0ce2a67297762a4bf5ae77ac6414eb0 Mon Sep 17 00:00:00 2001 From: Woosang Son Date: Fri, 17 Apr 2020 13:26:11 +0900 Subject: [PATCH] fix: reactor test failure --- consensus/state.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/consensus/state.go b/consensus/state.go index 19976df58..0729d6067 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1550,8 +1550,11 @@ func (cs *State) defaultSetProposal(proposal *types.Proposal) error { return ErrInvalidProposalPOLRound } + // If consensus does not enterNewRound yet, cs.Proposer may be nil or prior proposer, so don't use cs.Proposer + proposer := types.SelectProposer(cs.Validators, cs.state.LastProofHash, proposal.Height, proposal.Round) + // Verify signature - if !cs.Proposer.PubKey.VerifyBytes(proposal.SignBytes(cs.state.ChainID), proposal.Signature) { + if !proposer.PubKey.VerifyBytes(proposal.SignBytes(cs.state.ChainID), proposal.Signature) { return ErrInvalidProposalSignature }