提交 c4864449 编写于 作者: O obscuren

Fixed whisper pub key bug

* Unrecoverable messages would cause segfault when recovering invalid
  pub key
上级 54927dc0
......@@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey {
}
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
if pub == nil {
if pub == nil || pub.X == nil || pub.Y == nil {
return nil
}
return elliptic.Marshal(S256(), pub.X, pub.Y)
......
......@@ -197,7 +197,7 @@ func (self *Whisper) add(envelope *Envelope) error {
go self.postEvent(envelope)
}
wlogger.DebugDetailln("added whisper message")
wlogger.DebugDetailf("added whisper envelope %x\n", envelope)
return nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册