From e5a03eb0661a70c9a068fdf85f1cb31effbf26f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 16 Apr 2015 18:24:39 +0300 Subject: [PATCH] whisper: don't issue signature warning if none present --- whisper/message.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/whisper/message.go b/whisper/message.go index 0513627b4..07c673567 100644 --- a/whisper/message.go +++ b/whisper/message.go @@ -94,6 +94,11 @@ func (self *Message) sign(key *ecdsa.PrivateKey) (err error) { func (self *Message) Recover() *ecdsa.PublicKey { defer func() { recover() }() // in case of invalid signature + // Short circuit if no signature is present + if self.Signature == nil { + return nil + } + // Otherwise try and recover the signature pub, err := crypto.SigToPub(self.hash(), self.Signature) if err != nil { glog.V(logger.Error).Infof("Could not get public key from signature: %v", err)