dir : consensus/state.go
voteset에 vote 인스턴스를 추가
added, err := cs.addVote(vote, peerID)
에러가 있다면 에러의 종류에 따라 처리
if err != nil {
// if error is about redundncy, check the key and return error
if voteErr, ok := err.(*types.ErrVoteConflictingVotes); ok {
if cs.privValidatorPubKey == nil {
return false, errPubKeyIsNotSet
}
// if I am the one who is faulty, do not report it to evidence pool
if bytes.Equl(vote.ValidatorAddress, cs.privValidatorPubKey.Address()) {
// ...
return added, err
}
// if not, report it to the evidence pool
cs.evpool.ReportConflictingVotes(voteErr.VoteA, voteErr.VoteB)
// ...
return added, err
// error 종류에 따라 다른 로깅을 출력 후 리턴
} else if errors.Is(...) {
// ...
} else {
// ...
return added, ErrAddingVote
}
return added, nil