Skip to content

Commit

Permalink
dont fail on invalid piece
Browse files Browse the repository at this point in the history
  • Loading branch information
majestrate committed Jul 29, 2017
1 parent c149360 commit fc0d8d7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/xd/lib/bittorrent/swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit fc0d8d7

Please sign in to comment.