diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-08-13 15:13:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 15:13:41 +0800 |
commit | a8ebf501e54406c7449f71dba0c9af696bbc4e21 (patch) | |
tree | 37ae1a53769d6f7be82ed576b1fd65a476c11d17 /core/types | |
parent | 63c76e56169b6f14ef049490392a1b3b414f73c6 (diff) | |
download | dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.tar dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.tar.gz dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.tar.bz2 dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.tar.lz dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.tar.xz dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.tar.zst dexon-consensus-a8ebf501e54406c7449f71dba0c9af696bbc4e21.zip |
core: Sign block in Consensus.PrepareBlock. (#50)
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/validator.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/types/validator.go b/core/types/validator.go index 27a9acd..5151a6d 100644 --- a/core/types/validator.go +++ b/core/types/validator.go @@ -35,6 +35,11 @@ func NewValidatorID(pubKey crypto.PublicKey) ValidatorID { return ValidatorID{Hash: crypto.Keccak256Hash(pubKey.Bytes())} } +// Equal checks if the hash representation is the same ValidatorID. +func (v ValidatorID) Equal(hash common.Hash) bool { + return v.Hash == hash +} + // ValidatorIDs implements sort.Interface for ValidatorID. type ValidatorIDs []ValidatorID |