diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-16 23:24:39 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-04-16 23:24:39 +0800 |
commit | e5a03eb0661a70c9a068fdf85f1cb31effbf26f5 (patch) | |
tree | 1c213919f2e19c50afe358667ebbe392816fdb93 | |
parent | e5e91e9eb394e7b495666834586073052dc58265 (diff) | |
download | go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.tar go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.tar.gz go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.tar.bz2 go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.tar.lz go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.tar.xz go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.tar.zst go-tangerine-e5a03eb0661a70c9a068fdf85f1cb31effbf26f5.zip |
whisper: don't issue signature warning if none present
-rw-r--r-- | whisper/message.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) |