Skip to content

Commit

Permalink
Merge pull request #2704 from tendermint/2702-proposal-pol-round-vali…
Browse files Browse the repository at this point in the history
…dation

if some process locks a block in round 0, then 0 is valid proposal.PO…
  • Loading branch information
ebuchman committed Nov 6, 2018
2 parents 59b75d3 + 8760c5b commit 071ebdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1408,9 +1408,9 @@ func (cs *ConsensusState) defaultSetProposal(proposal *types.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) {
// Verify POLRound, which must be -1 or in range [0, proposal.Round).
if proposal.POLRound < -1 ||
(proposal.POLRound >= 0 && proposal.POLRound >= proposal.Round) {
return ErrInvalidProposalPOLRound
}

Expand Down
2 changes: 1 addition & 1 deletion types/vote_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) {
if (vote.Height != voteSet.height) ||
(vote.Round != voteSet.round) ||
(vote.Type != voteSet.type_) {
return false, errors.Wrapf(ErrVoteUnexpectedStep, "Got %d/%d/%d, expected %d/%d/%d",
return false, errors.Wrapf(ErrVoteUnexpectedStep, "Expected %d/%d/%d, but got %d/%d/%d",
voteSet.height, voteSet.round, voteSet.type_,
vote.Height, vote.Round, vote.Type)
}
Expand Down

0 comments on commit 071ebdd

Please sign in to comment.