VoteSet can handle conflicting votes. TODO: add more tests

This commit is contained in:
Jae Kwon
2016-11-15 18:33:16 -05:00
committed by Ethan Buchman
parent 3c5a2f55c2
commit 7221887330
3 changed files with 284 additions and 77 deletions
+1 -1
View File
@@ -1400,7 +1400,7 @@ func (cs *ConsensusState) tryAddVote(vote *types.Vote, peerKey string) error {
// If it's otherwise invalid, punish peer.
if err == ErrVoteHeightMismatch {
return err
} else if _, ok := err.(*types.ErrVoteConflictingSignature); ok {
} else if _, ok := err.(*types.ErrVoteConflictingVotes); ok {
if peerKey == "" {
log.Warn("Found conflicting vote from ourselves. Did you unsafe_reset a validator?", "height", vote.Height, "round", vote.Round, "type", vote.Type)
return err