Update Torrent.wantPeersEvent in several places

This commit is contained in:
Matt Joiner 2016-05-23 10:19:14 +10:00
parent 5051d1dcd0
commit c6ec935e53
2 changed files with 3 additions and 0 deletions

View File

@ -1508,6 +1508,7 @@ func (cl *Client) AddTorrentInfoHash(infoHash metainfo.Hash) (t *Torrent, new bo
go cl.announceTorrentDHT(t, true)
}
cl.torrents[infoHash] = t
t.updateWantPeersEvent()
return
}

View File

@ -519,6 +519,7 @@ func (t *Torrent) close() (err error) {
conn.Close()
}
t.pieceStateChanges.Close()
t.updateWantPeersEvent()
return
}
@ -1076,6 +1077,7 @@ func (t *Torrent) addTrackers(announceList [][]string) {
(*fullAnnounceList)[tierIndex] = appendMissingStrings((*fullAnnounceList)[tierIndex], trackerURLs)
}
t.startMissingTrackerScrapers()
t.updateWantPeersEvent()
}
// Don't call this before the info is available.