Wanting peers is a subset of wanting conns

This commit is contained in:
Matt Joiner 2021-11-28 22:37:56 +11:00
parent f621f0f5a8
commit b196fe7765
1 changed files with 2 additions and 1 deletions

View File

@ -1405,6 +1405,7 @@ func (t *Torrent) dropConnection(c *PeerConn) {
}
}
// Peers as in contact information for dialing out.
func (t *Torrent) wantPeers() bool {
if t.closed.IsSet() {
return false
@ -1412,7 +1413,7 @@ func (t *Torrent) wantPeers() bool {
if t.peers.Len() > t.cl.config.TorrentPeersLowWater {
return false
}
return t.needData() || t.seeding()
return t.wantConns()
}
func (t *Torrent) updateWantPeersEvent() {