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();