From 71c66eecee8d66e5529b80888588cadb6bd5090f Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Wed, 16 Oct 2024 12:02:14 -0700 Subject: [PATCH] Change comment to indicate the bug --- p2p/host/autonat/autonat.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/p2p/host/autonat/autonat.go b/p2p/host/autonat/autonat.go index ddf13dc763..6d3c9e242f 100644 --- a/p2p/host/autonat/autonat.go +++ b/p2p/host/autonat/autonat.go @@ -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)