]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Wanting peers is a subset of wanting conns
authorMatt Joiner <anacrolix@gmail.com>
Sun, 28 Nov 2021 11:37:56 +0000 (22:37 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 28 Nov 2021 11:40:55 +0000 (22:40 +1100)
torrent.go

index 244d3281b06f140c24266002cb1cdb53aa7824a2..45540b68589c1f2d8bdafd24b6d71616ab874490 100644 (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() {