aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-04 19:03:43 +0800
committerFelix Lange <fjl@twurst.com>2015-03-04 19:27:24 +0800
commit7964f30dcbdde00b2960ef6e98320e0a0f9300e2 (patch)
treeadd3fbd54ec615135f3ecdac2917d22e77581d56 /p2p/peer.go
parent21649100b1ed64c9bd73c547360dd6db9b5218fb (diff)
downloadgo-tangerine-7964f30dcbdde00b2960ef6e98320e0a0f9300e2.tar.gz
go-tangerine-7964f30dcbdde00b2960ef6e98320e0a0f9300e2.tar.zst
go-tangerine-7964f30dcbdde00b2960ef6e98320e0a0f9300e2.zip
p2p: msg.Payload contains list data
With RLPx frames, the message code is contained in the frame and is no longer part of the encoded data. EncodeMsg, Msg.Decode have been updated to match. Code that decodes RLP directly from Msg.Payload will need to change.
Diffstat (limited to 'p2p/peer.go')
-rw-r--r--p2p/peer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/p2p/peer.go b/p2p/peer.go
index 4982c4612..025be4ba9 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -193,12 +193,12 @@ func (p *Peer) handle(msg Msg) error {
msg.Discard()
go EncodeMsg(p.rw, pongMsg)
case msg.Code == discMsg:
- var reason DiscReason
+ var reason [1]DiscReason
// no need to discard or for error checking, we'll close the
// connection after this.
rlp.Decode(msg.Payload, &reason)
p.Disconnect(DiscRequested)
- return discRequestedError(reason)
+ return discRequestedError(reason[0])
case msg.Code < baseProtocolLength:
// ignore other base protocol messages
return msg.Discard()