forked from cerc-io/plugeth
Fixed whisper pub key bug
* Unrecoverable messages would cause segfault when recovering invalid pub key
This commit is contained in:
parent
54927dc0e0
commit
c48644490f
@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
|
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
|
||||||
if pub == nil {
|
if pub == nil || pub.X == nil || pub.Y == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return elliptic.Marshal(S256(), pub.X, pub.Y)
|
return elliptic.Marshal(S256(), pub.X, pub.Y)
|
||||||
|
@ -197,7 +197,7 @@ func (self *Whisper) add(envelope *Envelope) error {
|
|||||||
go self.postEvent(envelope)
|
go self.postEvent(envelope)
|
||||||
}
|
}
|
||||||
|
|
||||||
wlogger.DebugDetailln("added whisper message")
|
wlogger.DebugDetailf("added whisper envelope %x\n", envelope)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user