From bdf86f25579bdf9b1e2d6496dc78b9f6c61fdd8b Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Mon, 24 Jul 2023 20:58:45 +0800 Subject: [PATCH] improve: use bytes.Equal to compare bls pubkeys --- core/vote/vote_signer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/vote/vote_signer.go b/core/vote/vote_signer.go index 03d89d53c7..c2cda513f0 100644 --- a/core/vote/vote_signer.go +++ b/core/vote/vote_signer.go @@ -1,6 +1,7 @@ package vote import ( + "bytes" "context" "fmt" "io/ioutil" @@ -106,5 +107,5 @@ func (signer *VoteSigner) SignVote(vote *types.VoteEnvelope) error { } func (signer *VoteSigner) UsingKey(bLSPublicKey *types.BLSPublicKey) bool { - return types.BLSPublicKey(signer.pubKey) == *bLSPublicKey + return bytes.Equal(signer.pubKey[:], bLSPublicKey[:]) }