From 7bd2fbe2b1445c26190008d21ad52dc5c364765c Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 3 Feb 2015 07:16:05 -0800 Subject: Fixed whisper "to" filtering. Closes #283 --- whisper/message.go | 4 ++-- whisper/whisper.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'whisper') diff --git a/whisper/message.go b/whisper/message.go index fa631b2ef..23b5cfb0e 100644 --- a/whisper/message.go +++ b/whisper/message.go @@ -11,11 +11,11 @@ type Message struct { Flags byte Signature []byte Payload []byte - Sent uint64 + Sent int64 } func NewMessage(payload []byte) *Message { - return &Message{Flags: 0, Payload: payload} + return &Message{Flags: 0, Payload: payload, Sent: time.Now().Unix()} } func (self *Message) hash() []byte { diff --git a/whisper/whisper.go b/whisper/whisper.go index 8eab0825b..cc0348422 100644 --- a/whisper/whisper.go +++ b/whisper/whisper.go @@ -269,7 +269,7 @@ func (self *Whisper) Protocol() p2p.Protocol { func createFilter(message *Message, topics [][]byte, key *ecdsa.PrivateKey) filter.Filter { return filter.Generic{ - Str1: string(crypto.FromECDSA(key)), Str2: string(crypto.FromECDSAPub(message.Recover())), + Str1: string(crypto.FromECDSAPub(&key.PublicKey)), Str2: string(crypto.FromECDSAPub(message.Recover())), Data: bytesToMap(topics), } } -- cgit