Forward and log EC recover err and remove dup pubkey len check
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
@ -80,9 +81,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(0).Infof("EC RECOVER FAIL: ", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user