From 549c937fdfdc97b44cc7335956b4beaaf92399d2 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 16 Aug 2017 19:24:52 -0400 Subject: [PATCH] fix logging problem with peerid --- src/xd/lib/bittorrent/swarm/swarm.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xd/lib/bittorrent/swarm/swarm.go b/src/xd/lib/bittorrent/swarm/swarm.go index aed9c16..41ac49e 100644 --- a/src/xd/lib/bittorrent/swarm/swarm.go +++ b/src/xd/lib/bittorrent/swarm/swarm.go @@ -86,9 +86,10 @@ func (sw *Swarm) inboundConn(c net.Conn) { opts = extensions.New() } // reply to handshake + var id common.PeerID + copy(id[:], h.PeerID[:]) copy(h.PeerID[:], sw.id[:]) err = h.Send(c) - if err != nil { log.Warnf("didn't send bittorrent handshake reply: %s, closing connection", err) // write error @@ -96,7 +97,7 @@ func (sw *Swarm) inboundConn(c net.Conn) { return } // make peer conn - p := makePeerConn(c, t, h.PeerID, opts) + p := makePeerConn(c, t, id, opts) go p.runWriter() go p.runReader()