diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-08 02:48:56 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-08 02:48:56 +0800 |
commit | 758205b187e079080193c2fed2a21caff2377329 (patch) | |
tree | f8c82d47703aac292ab549c8fe3bfaf046075c1a /core/vm/address.go | |
parent | f5978639279bac0bcd6270ebb4589099bae570ed (diff) | |
parent | 2591883a18113f1b60e6057313ff552c92d7f261 (diff) | |
download | go-tangerine-758205b187e079080193c2fed2a21caff2377329.tar.gz go-tangerine-758205b187e079080193c2fed2a21caff2377329.tar.zst go-tangerine-758205b187e079080193c2fed2a21caff2377329.zip |
Merge pull request #648 from Gustav-Simonsson/forward_ecrecover_err_and_remove_dup_checks
Forward and log EC recover err and remove dup pubkey len check
Diffstat (limited to 'core/vm/address.go')
-rw-r--r-- | core/vm/address.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/vm/address.go b/core/vm/address.go index df801863f..742017dd2 100644 --- a/core/vm/address.go +++ b/core/vm/address.go @@ -5,6 +5,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/params" ) @@ -80,9 +82,10 @@ func ecrecoverFunc(in []byte) []byte { // v needs to be moved to the end rsv := append(in[64:128], byte(v.Uint64())) - pubKey := crypto.Ecrecover(in[:32], rsv) + pubKey, err := crypto.Ecrecover(in[:32], rsv) // make sure the public key is a valid one - if pubKey == nil || len(pubKey) != 65 { + if err != nil { + glog.V(logger.Error).Infof("EC RECOVER FAIL: ", err) return nil } |