aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisper.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r--whisper/whisper.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index cc0348422..066f2c4ea 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -118,7 +118,7 @@ func (self *Whisper) GetIdentity(key *ecdsa.PublicKey) *ecdsa.PrivateKey {
func (self *Whisper) Watch(opts Filter) int {
return self.filters.Install(filter.Generic{
- Str1: string(crypto.FromECDSA(opts.To)),
+ Str1: string(crypto.FromECDSAPub(opts.To)),
Str2: string(crypto.FromECDSAPub(opts.From)),
Data: bytesToMap(opts.Topics),
Fn: func(data interface{}) {
@@ -256,6 +256,8 @@ func (self *Whisper) postEvent(envelope *Envelope) {
func (self *Whisper) open(envelope *Envelope) (*Message, *ecdsa.PrivateKey) {
for _, key := range self.keys {
if message, err := envelope.Open(key); err == nil || (err != nil && err == ecies.ErrInvalidPublicKey) {
+ message.To = &key.PublicKey
+
return message, key
}
}