aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-09 04:41:32 +0800
committerobscuren <geffobscura@gmail.com>2015-01-09 04:41:32 +0800
commit4a0ade4788b0e8d53c6b0eabaf9652643b6a073a (patch)
tree57a477ec1419547130ca75638fb2df71f883b4f4 /whisper
parent5f958a582d1326ada1cb34b4c6578590a7c40e6c (diff)
downloaddexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar
dexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.gz
dexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.bz2
dexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.lz
dexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.xz
dexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.zst
dexon-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.zip
Fixed some whisper issues
Diffstat (limited to 'whisper')
-rw-r--r--whisper/message.go2
-rw-r--r--whisper/peer.go2
-rw-r--r--whisper/whisper.go2
3 files changed, 4 insertions, 2 deletions
diff --git a/whisper/message.go b/whisper/message.go
index db0110b4a..5bda849ec 100644
--- a/whisper/message.go
+++ b/whisper/message.go
@@ -2,6 +2,7 @@ package whisper
import (
"crypto/ecdsa"
+ "fmt"
"time"
"github.com/ethereum/go-ethereum/crypto"
@@ -53,6 +54,7 @@ type Opts struct {
}
func (self *Message) Seal(pow time.Duration, opts Opts) (*Envelope, error) {
+ fmt.Println(opts)
if opts.From != nil {
err := self.sign(opts.From)
if err != nil {
diff --git a/whisper/peer.go b/whisper/peer.go
index d42b374b5..f82cc6e3e 100644
--- a/whisper/peer.go
+++ b/whisper/peer.go
@@ -55,7 +55,7 @@ out:
case <-relay.C:
err := self.broadcast(self.host.envelopes())
if err != nil {
- self.peer.Infoln(err)
+ self.peer.Infoln("broadcast err:", err)
break out
}
diff --git a/whisper/whisper.go b/whisper/whisper.go
index ffcdd7d40..3ff4bac5a 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -229,11 +229,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)
}