From b8827ce6190741250d6ee7b5a10c69f97663fb27 Mon Sep 17 00:00:00 2001 From: b-l-u-e Date: Mon, 5 Jan 2026 21:52:15 +0300 Subject: [PATCH] net: Fix Discover() not running when using -bind=0.0.0.0:port Signed-off-by: b-l-u-e --- src/init.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index e6cc2045b4a..9c22c3c51b7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2140,7 +2140,26 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) StartTorControl(onion_service_target); } - if (connOptions.bind_on_any) { + bool should_discover = connOptions.bind_on_any; + if (!should_discover) { + for (const auto& bind : connOptions.vBinds) { + if (bind.IsBindAny()) { + should_discover = true; + break; + } + } + } + + if (!should_discover) { + for (const auto& whitebind : connOptions.vWhiteBinds) { + if (whitebind.m_service.IsBindAny()) { + should_discover = true; + break; + } + } + } + + if (should_discover) { // Only add all IP addresses of the machine if we would be listening on // any address - 0.0.0.0 (IPv4) and :: (IPv6). Discover();