From 97e1e2469b44c20e6dab335d674307e5574a64a1 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 28 Nov 2021 22:46:45 +1100 Subject: [PATCH] Announce to DHT if we want conns, not just peers --- torrent.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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. -- 2.48.1