From: Matt Joiner Date: Sun, 28 Nov 2021 11:46:45 +0000 (+1100) Subject: Announce to DHT if we want conns, not just peers X-Git-Tag: v1.39.0~39 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=97e1e2469b44c20e6dab335d674307e5574a64a1;p=btrtrc.git Announce to DHT if we want conns, not just peers --- diff --git a/torrent.go b/torrent.go index 45540b68..79a3ecb6 100644 --- a/torrent.go +++ b/torrent.go @@ -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.