2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Announce to DHT if we want conns, not just peers

This commit is contained in:
Matt Joiner 2021-11-28 22:46:45 +11:00
parent b196fe7765
commit 97e1e2469b

View 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.