aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-19 22:18:31 +0800
committerFelix Lange <fjl@twurst.com>2015-03-19 22:18:31 +0800
commite80dda605130479086bed363e395a102a89a574a (patch)
treef5ddd0887d1366794d10ee43b656a7d15fefc945 /whisper
parentb9e0b11e7da387bbb426d25c36d495c4f099722f (diff)
downloaddexon-e80dda605130479086bed363e395a102a89a574a.tar.gz
dexon-e80dda605130479086bed363e395a102a89a574a.tar.zst
dexon-e80dda605130479086bed363e395a102a89a574a.zip
eth, whisper: adapt for RLP encoder switch in package p2p
I have rewritten the protocol test to use p2p.MsgPipe because p2p.NewMsg is gone.
Diffstat (limited to 'whisper')
-rw-r--r--whisper/envelope.go2
-rw-r--r--whisper/peer.go9
2 files changed, 3 insertions, 8 deletions
diff --git a/whisper/envelope.go b/whisper/envelope.go
index 577638046..9ec9fc318 100644
--- a/whisper/envelope.go
+++ b/whisper/envelope.go
@@ -6,9 +6,9 @@ import (
"fmt"
"time"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/ecies"
- "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
)
diff --git a/whisper/peer.go b/whisper/peer.go
index 4bd9428f5..ee5bffd0b 100644
--- a/whisper/peer.go
+++ b/whisper/peer.go
@@ -77,12 +77,11 @@ func (self *peer) broadcast(envelopes []*Envelope) error {
}
if i > 0 {
- if err := p2p.EncodeMsg(self.ws, envelopesMsg, envs[:i]...); err != nil {
+ if err := p2p.Send(self.ws, envelopesMsg, envs[:i]); err != nil {
return err
}
self.peer.DebugDetailln("broadcasted", i, "message(s)")
}
-
return nil
}
@@ -92,7 +91,7 @@ func (self *peer) addKnown(envelope *Envelope) {
func (self *peer) handleStatus() error {
ws := self.ws
- if err := ws.WriteMsg(self.statusMsg()); err != nil {
+ if err := p2p.SendItems(ws, statusMsg, protocolVersion); err != nil {
return err
}
msg, err := ws.ReadMsg()
@@ -115,7 +114,3 @@ func (self *peer) handleStatus() error {
}
return msg.Discard() // ignore anything after protocol version
}
-
-func (self *peer) statusMsg() p2p.Msg {
- return p2p.NewMsg(statusMsg, protocolVersion)
-}