From 61ea42c57024fc4c4ab9e17204428c61b433730f Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 25 Aug 2021 19:26:17 +0300 Subject: [PATCH] keys: simplify end of buffer check --- pkg/crypto/keys/publickey.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/crypto/keys/publickey.go b/pkg/crypto/keys/publickey.go index 876b044c2..be3a799ce 100644 --- a/pkg/crypto/keys/publickey.go +++ b/pkg/crypto/keys/publickey.go @@ -8,7 +8,6 @@ import ( "encoding/json" "errors" "fmt" - gio "io" "math/big" "github.com/btcsuite/btcd/btcec" @@ -220,8 +219,7 @@ func (p *PublicKey) DecodeBytes(data []byte) error { return b.Err } - b.ReadB() - if b.Err != gio.EOF { + if b.Len() != 0 { return errors.New("extra data") } return nil