net: Fix Discover() not running when using -bind=0.0.0.0:port

Signed-off-by: b-l-u-e <winnie.gitau282@gmail.com>
This commit is contained in:
b-l-u-e
2026-01-05 21:52:15 +03:00
parent b65ff0e5a1
commit b8827ce619

View File

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