mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 19:53:58 +00:00
verify evidence in block
This commit is contained in:
@@ -101,3 +101,14 @@ func (vote *Vote) String() string {
|
||||
cmn.Fingerprint(vote.BlockID.Hash), vote.Signature,
|
||||
CanonicalTime(vote.Timestamp))
|
||||
}
|
||||
|
||||
func (vote *Vote) Verify(chainID string, pubKey crypto.PubKey) error {
|
||||
if !bytes.Equal(pubKey.Address(), v.ValidatorAddress) {
|
||||
return ErrVoteInvalidValidatorAddress
|
||||
}
|
||||
|
||||
if !pubKey.VerifyBytes(SignBytes(chainID, vote), vote.Signature) {
|
||||
return ErrVoteInvalidSignature
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user