Use logger.Error instead of 0 with glog
This commit is contained in:
parent
3f306f63d4
commit
2591883a18
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/crypto/secp256k1"
|
"github.com/ethereum/go-ethereum/crypto/secp256k1"
|
||||||
|
"github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/ethereum/go-ethereum/logger/glog"
|
"github.com/ethereum/go-ethereum/logger/glog"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
)
|
)
|
||||||
@ -132,7 +133,7 @@ func (tx *Transaction) PublicKey() []byte {
|
|||||||
//pubkey, _ := secp256k1.RecoverPubkey(hash[:], sig)
|
//pubkey, _ := secp256k1.RecoverPubkey(hash[:], sig)
|
||||||
p, err := crypto.SigToPub(hash[:], sig)
|
p, err := crypto.SigToPub(hash[:], sig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(0).Infof("Could not get pubkey from signature: ", err)
|
glog.V(logger.Error).Infof("Could not get pubkey from signature: ", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
pubkey := crypto.FromECDSAPub(p)
|
pubkey := crypto.FromECDSAPub(p)
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/ethereum/go-ethereum/logger/glog"
|
"github.com/ethereum/go-ethereum/logger/glog"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
)
|
)
|
||||||
@ -84,7 +85,7 @@ func ecrecoverFunc(in []byte) []byte {
|
|||||||
pubKey, err := crypto.Ecrecover(in[:32], rsv)
|
pubKey, err := crypto.Ecrecover(in[:32], rsv)
|
||||||
// make sure the public key is a valid one
|
// make sure the public key is a valid one
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(0).Infof("EC RECOVER FAIL: ", err)
|
glog.V(logger.Error).Infof("EC RECOVER FAIL: ", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/ethereum/go-ethereum/logger/glog"
|
"github.com/ethereum/go-ethereum/logger/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ func (self *Message) Recover() *ecdsa.PublicKey {
|
|||||||
defer func() { recover() }() // in case of invalid sig
|
defer func() { recover() }() // in case of invalid sig
|
||||||
pub, err := crypto.SigToPub(self.hash(), self.Signature)
|
pub, err := crypto.SigToPub(self.hash(), self.Signature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(0).Infof("Could not get pubkey from signature: ", err)
|
glog.V(logger.Error).Infof("Could not get pubkey from signature: ", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return pub
|
return pub
|
||||||
|
Loading…
Reference in New Issue
Block a user