aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisper.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r--whisper/whisper.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index ffcdd7d40..71a4e841e 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -4,6 +4,7 @@ import (
"bytes"
"crypto/ecdsa"
"errors"
+ "fmt"
"sync"
"time"
@@ -143,6 +144,7 @@ func (self *Whisper) msgHandler(peer *p2p.Peer, ws p2p.MsgReadWriter) error {
if err != nil {
return err
}
+ fmt.Println("reading message")
envelope, err := NewEnvelopeFromReader(msg.Payload)
if err != nil {
@@ -160,6 +162,7 @@ func (self *Whisper) msgHandler(peer *p2p.Peer, ws p2p.MsgReadWriter) error {
// takes care of adding envelopes to the messages pool. At this moment no sanity checks are being performed.
func (self *Whisper) add(envelope *Envelope) error {
+ fmt.Println("adding")
if !envelope.valid() {
return errors.New("invalid pow provided for envelope")
}
@@ -229,11 +232,11 @@ func (self *Whisper) envelopes() (envelopes []*Envelope) {
func (self *Whisper) postEvent(envelope *Envelope) {
for _, key := range self.keys {
if message, err := envelope.Open(key); err == nil || (err != nil && err == ecies.ErrInvalidPublicKey) {
- // Create a custom filter?
self.filters.Notify(filter.Generic{
Str1: string(crypto.FromECDSA(key)), Str2: string(crypto.FromECDSAPub(message.Recover())),
Data: bytesToMap(envelope.Topics),
}, message)
+ break
} else {
wlogger.Infoln(err)
}