mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 12:41:44 +00:00
Refactor "lite" to handle delayed validator set changes.
Also, fix consensus liveness issue.
This commit is contained in:
@ -170,7 +170,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) {
|
||||
"Cannot find validator %d in valSet of size %d", valIndex, voteSet.valSet.Size())
|
||||
}
|
||||
|
||||
// Ensure that the signer has the right address
|
||||
// Ensure that the signer has the right address.
|
||||
if !bytes.Equal(valAddr, lookupAddr) {
|
||||
return false, errors.Wrapf(ErrVoteInvalidValidatorAddress,
|
||||
"vote.ValidatorAddress (%X) does not match address (%X) for vote.ValidatorIndex (%d)\nEnsure the genesis file is correct across all validators.",
|
||||
@ -190,7 +190,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) {
|
||||
return false, errors.Wrapf(err, "Failed to verify vote with ChainID %s and PubKey %s", voteSet.chainID, val.PubKey)
|
||||
}
|
||||
|
||||
// Add vote and get conflicting vote if any
|
||||
// Add vote and get conflicting vote if any.
|
||||
added, conflicting := voteSet.addVerifiedVote(vote, blockKey, val.VotingPower)
|
||||
if conflicting != nil {
|
||||
return added, NewConflictingVoteError(val, conflicting, vote)
|
||||
@ -201,7 +201,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) {
|
||||
return added, nil
|
||||
}
|
||||
|
||||
// Returns (vote, true) if vote exists for valIndex and blockKey
|
||||
// Returns (vote, true) if vote exists for valIndex and blockKey.
|
||||
func (voteSet *VoteSet) getVote(valIndex int, blockKey string) (vote *Vote, ok bool) {
|
||||
if existing := voteSet.votes[valIndex]; existing != nil && existing.BlockID.Key() == blockKey {
|
||||
return existing, true
|
||||
|
Reference in New Issue
Block a user