Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,28 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
StartTorControl(onion_service_target);
}

if (connOptions.bind_on_any) {
// Determine if we should discover local addresses
bool should_discover = connOptions.bind_on_any;
if (!should_discover) {
// Check if any -bind address is 0.0.0.0 or ::
for (const auto& bind_addr : connOptions.vBinds) {
if (bind_addr.IsBindAny()) {
should_discover = true;
break;
}
}
}
if (!should_discover) {
// Check if any -whitebind address is 0.0.0.0 or ::
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();
Expand Down