From fc0d8d7a9bc8a3909c54d96b82dfd0732263de15 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 29 Jul 2017 10:56:31 -0400 Subject: [PATCH] dont fail on invalid piece --- src/xd/lib/bittorrent/swarm/swarm.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/xd/lib/bittorrent/swarm/swarm.go b/src/xd/lib/bittorrent/swarm/swarm.go index 53f9eff..1a9e643 100644 --- a/src/xd/lib/bittorrent/swarm/swarm.go +++ b/src/xd/lib/bittorrent/swarm/swarm.go @@ -102,13 +102,11 @@ func (sw *Swarm) inboundConn(c net.Conn) { // add a torrent to this swarm func (sw *Swarm) AddTorrent(t storage.Torrent, fresh bool) (err error) { if fresh { - err = t.VerifyAll(true) - } - if err == nil { - sw.Torrents.addTorrent(t) - tr := sw.Torrents.GetTorrent(t.Infohash()) - go sw.startTorrent(tr) + t.VerifyAll(true) } + sw.Torrents.addTorrent(t) + tr := sw.Torrents.GetTorrent(t.Infohash()) + go sw.startTorrent(tr) return }