From 2111cb9d7bc16fc65821d62a23d7895c9da02068 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 3 Jan 2015 14:16:48 +0100 Subject: [PATCH] p2p: fix peer list encoding It sent [0x5, [p1, p2, ...]] but needs to send [0x5, p1, p2, ...] --- p2p/protocol.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/p2p/protocol.go b/p2p/protocol.go index d13612fd60..50ea3a968d 100644 --- a/p2p/protocol.go +++ b/p2p/protocol.go @@ -3,8 +3,6 @@ package p2p import ( "bytes" "time" - - "github.com/ethereum/go-ethereum/ethutil" ) // Protocol represents a P2P subprotocol implementation. @@ -180,7 +178,7 @@ func (bp *baseProtocol) handle(rw MsgReadWriter) error { // // TODO: add event mechanism to notify baseProtocol for new peers if len(peers) > 0 { - return bp.rw.EncodeMsg(peersMsg, peers) + return bp.rw.EncodeMsg(peersMsg, peers...) } case peersMsg: @@ -272,9 +270,9 @@ func (bp *baseProtocol) handshakeMsg() Msg { ) } -func (bp *baseProtocol) peerList() []ethutil.RlpEncodable { +func (bp *baseProtocol) peerList() []interface{} { peers := bp.peer.otherPeers() - ds := make([]ethutil.RlpEncodable, 0, len(peers)) + ds := make([]interface{}, 0, len(peers)) for _, p := range peers { p.infolock.Lock() addr := p.listenAddr