mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-10 15:47:17 +02:00
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:
21
src/init.cpp
21
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();
|
||||
|
||||
Reference in New Issue
Block a user