From 3687bc0a094776f99db1d5be51acb181b79a7484 Mon Sep 17 00:00:00 2001 From: Prem Chaitanya Prathi Date: Tue, 13 Jan 2026 17:55:00 +0530 Subject: [PATCH] fix issue with extMultiAddrsOnly flag --- waku/factory/waku.nim | 3 +++ waku/node/waku_node.nim | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/waku/factory/waku.nim b/waku/factory/waku.nim index c452d44c5..08cdd6b1a 100644 --- a/waku/factory/waku.nim +++ b/waku/factory/waku.nim @@ -192,6 +192,9 @@ proc new*( error "Failed setting up node", error = $error return err("Failed setting up node: " & $error) + # Set the extMultiAddrsOnly flag so the node knows not to replace explicit addresses + node.extMultiAddrsOnly = wakuConf.endpointConf.extMultiAddrsOnly + healthMonitor.setNodeToHealthMonitor(node) healthMonitor.onlineMonitor.setPeerStoreToOnlineMonitor(node.switch.peerStore) healthMonitor.onlineMonitor.addOnlineStateObserver( diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index d556811ac..6fcc91f7c 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -131,6 +131,7 @@ type wakuRendezvous*: WakuRendezVous wakuRendezvousClient*: rendezvous_client.WakuRendezVousClient announcedAddresses*: seq[MultiAddress] + extMultiAddrsOnly*: bool # When true, skip automatic IP address replacement started*: bool # Indicates that node has started listening topicSubscriptionQueue*: AsyncEventQueue[SubscriptionEvent] rateLimitSettings*: ProtocolRateLimitSettings @@ -429,6 +430,11 @@ proc isBindIpWithZeroPort(inputMultiAdd: MultiAddress): bool = return false proc updateAnnouncedAddrWithPrimaryIpAddr*(node: WakuNode): Result[void, string] = + # Skip automatic IP replacement if extMultiAddrsOnly is set + # This respects the user's explicitly configured announced addresses + if node.extMultiAddrsOnly: + return ok() + let peerInfo = node.switch.peerInfo var announcedStr = "" var listenStr = ""