Skip to content

Commit

Permalink
Change comment to indicate the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Oct 16, 2024
1 parent ac95eea commit ada26c4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions p2p/host/autonat/autonat.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,9 @@ func (as *AmbientAutoNAT) background() {
defer as.subscriber.Close()
defer as.emitReachabilityChanged.Close()

// We want an update when our public non-relay listen addresses have changed.
// EvtLocalAddressesUpdated is a poor proxy for that. It works when the host is Public,
// but fails when the host is private and used with AutoRelay.
addrChangeTicker := time.NewTicker(1 * time.Minute)
// Fallback timer to update address in case EvtLocalAddressesUpdated is not emitted.
// TODO: The event not emitting properly is a bug. This is a workaround.
addrChangeTicker := time.NewTicker(30 * time.Minute)
defer addrChangeTicker.Stop()

timer := time.NewTimer(delay)
Expand Down

0 comments on commit ada26c4

Please sign in to comment.