aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
Diffstat (limited to 'whisper')
-rw-r--r--whisper/message.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/whisper/message.go b/whisper/message.go
index 5d9e5b5c1..ad6a1bcff 100644
--- a/whisper/message.go
+++ b/whisper/message.go
@@ -5,6 +5,8 @@ import (
"time"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/logger/glog"
)
type Message struct {
@@ -32,7 +34,12 @@ func (self *Message) sign(key *ecdsa.PrivateKey) (err error) {
func (self *Message) Recover() *ecdsa.PublicKey {
defer func() { recover() }() // in case of invalid sig
- return crypto.SigToPub(self.hash(), self.Signature)
+ pub, err := crypto.SigToPub(self.hash(), self.Signature)
+ if err != nil {
+ glog.V(logger.Error).Infof("Could not get pubkey from signature: ", err)
+ return nil
+ }
+ return pub
}
func (self *Message) Encrypt(to *ecdsa.PublicKey) (err error) {