aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-12 06:46:54 +0800
committerobscuren <geffobscura@gmail.com>2015-02-12 06:46:54 +0800
commitb64ad7a2a6544564b68f362f18c70476310396d6 (patch)
treee31866584192023142f17bad3aeff84a015c7f2c /whisper
parentda2fae0e437f9467a943acfe0571a8a24e8e76fd (diff)
parent3f6baa45a7fb1ae5fd7966d2763a2a776a65eb96 (diff)
downloadgo-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.tar
go-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.tar.gz
go-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.tar.bz2
go-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.tar.lz
go-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.tar.xz
go-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.tar.zst
go-tangerine-b64ad7a2a6544564b68f362f18c70476310396d6.zip
Merge branch 'develop' into miner
Diffstat (limited to 'whisper')
-rw-r--r--whisper/message.go2
-rw-r--r--whisper/whisper.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/whisper/message.go b/whisper/message.go
index 23b5cfb0e..5d9e5b5c1 100644
--- a/whisper/message.go
+++ b/whisper/message.go
@@ -12,6 +12,8 @@ type Message struct {
Signature []byte
Payload []byte
Sent int64
+
+ To *ecdsa.PublicKey
}
func NewMessage(payload []byte) *Message {
diff --git a/whisper/whisper.go b/whisper/whisper.go
index 57c898303..066f2c4ea 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -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
}
}