mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-22 09:21:32 +00:00
ProposalPOLRound...
This commit is contained in:
@ -126,6 +126,7 @@ var (
|
||||
|
||||
var (
|
||||
ErrInvalidProposalSignature = errors.New("Error invalid proposal signature")
|
||||
ErrInvalidProposalPOLRound = errors.New("Error invalid proposal POL round")
|
||||
)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -900,6 +901,12 @@ func (cs *ConsensusState) SetProposal(proposal *Proposal) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Verify POLRound, which must be -1 or between 0 and proposal.Round exclusive.
|
||||
if proposal.POLRound != -1 &&
|
||||
(proposal.POLRound < 0 || proposal.Round <= proposal.POLRound) {
|
||||
return ErrInvalidProposalPOLRound
|
||||
}
|
||||
|
||||
// Verify signature
|
||||
if !cs.Validators.Proposer().PubKey.VerifyBytes(account.SignBytes(cs.state.ChainID, proposal), proposal.Signature) {
|
||||
return ErrInvalidProposalSignature
|
||||
|
Reference in New Issue
Block a user