diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-04-06 01:31:18 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-04-07 18:48:19 +0800 |
commit | 3f306f63d48f011a527e301e3bf9aec2d6efb7e1 (patch) | |
tree | 527dc3f1c6a0ededd135c4fe7236454a3a300308 /core/types/transaction.go | |
parent | 7c583f82228fb373dd6bbe15effb68cf5aac0ad9 (diff) | |
download | go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.gz go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.zst go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.zip |
Forward and log EC recover err and remove dup pubkey len check
Diffstat (limited to 'core/types/transaction.go')
-rw-r--r-- | core/types/transaction.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go index 6f438ad9d..2f23a7960 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/secp256k1" + "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/rlp" ) @@ -129,7 +130,12 @@ func (tx *Transaction) PublicKey() []byte { //pubkey := crypto.Ecrecover(append(hash[:], sig...)) //pubkey, _ := secp256k1.RecoverPubkey(hash[:], sig) - pubkey := crypto.FromECDSAPub(crypto.SigToPub(hash[:], sig)) + p, err := crypto.SigToPub(hash[:], sig) + if err != nil { + glog.V(0).Infof("Could not get pubkey from signature: ", err) + return nil + } + pubkey := crypto.FromECDSAPub(p) return pubkey } |