]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Announce to DHT if we want conns, not just peers
authorMatt Joiner <anacrolix@gmail.com>
Sun, 28 Nov 2021 11:46:45 +0000 (22:46 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 28 Nov 2021 11:46:45 +0000 (22:46 +1100)
torrent.go

index 45540b68589c1f2d8bdafd24b6d71616ab874490..79a3ecb65ddd7a3064ad5b244eb5f72d48da5a86 100644 (file)
@@ -1671,7 +1671,10 @@ func (t *Torrent) dhtAnnouncer(s DhtServer) {
                        if t.closed.IsSet() {
                                return
                        }
-                       if !t.wantPeers() {
+                       // We're also announcing ourselves as a listener, so we don't just want peer addresses.
+                       // TODO: We can include the announce_peer step depending on whether we can receive
+                       // inbound connections. We should probably only announce once every 15 mins too.
+                       if !t.wantConns() {
                                goto wait
                        }
                        // TODO: Determine if there's a listener on the port we're announcing.