mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 842e2a9c54 into merged_master (Bitcoin PR bitcoin/bitcoin#20234)
This commit is contained in:
commit
a4a4d73a44
5 changed files with 129 additions and 29 deletions
33
src/init.cpp
33
src/init.cpp
|
|
@ -1778,18 +1778,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
return InitError(ResolveErrMsg("bind", bind_arg));
|
||||
}
|
||||
|
||||
if (connOptions.onion_binds.empty()) {
|
||||
connOptions.onion_binds.push_back(DefaultOnionServiceTarget());
|
||||
}
|
||||
|
||||
if (args.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) {
|
||||
const auto bind_addr = connOptions.onion_binds.front();
|
||||
if (connOptions.onion_binds.size() > 1) {
|
||||
InitWarning(strprintf(_("More than one onion bind address is provided. Using %s for the automatically created Tor onion service."), bind_addr.ToStringIPPort()));
|
||||
}
|
||||
StartTorControl(bind_addr);
|
||||
}
|
||||
|
||||
for (const std::string& strBind : args.GetArgs("-whitebind")) {
|
||||
NetWhitebindPermissions whitebind;
|
||||
bilingual_str error;
|
||||
|
|
@ -1797,6 +1785,27 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
connOptions.vWhiteBinds.push_back(whitebind);
|
||||
}
|
||||
|
||||
// If the user did not specify -bind= or -whitebind= then we bind
|
||||
// on any address - 0.0.0.0 (IPv4) and :: (IPv6).
|
||||
connOptions.bind_on_any = args.GetArgs("-bind").empty() && args.GetArgs("-whitebind").empty();
|
||||
|
||||
CService onion_service_target;
|
||||
if (!connOptions.onion_binds.empty()) {
|
||||
onion_service_target = connOptions.onion_binds.front();
|
||||
} else {
|
||||
onion_service_target = DefaultOnionServiceTarget();
|
||||
connOptions.onion_binds.push_back(onion_service_target);
|
||||
}
|
||||
|
||||
if (args.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) {
|
||||
if (connOptions.onion_binds.size() > 1) {
|
||||
InitWarning(strprintf(_("More than one onion bind address is provided. Using %s "
|
||||
"for the automatically created Tor onion service."),
|
||||
onion_service_target.ToStringIPPort()));
|
||||
}
|
||||
StartTorControl(onion_service_target);
|
||||
}
|
||||
|
||||
for (const auto& net : args.GetArgs("-whitelist")) {
|
||||
NetWhitelistPermissions subnet;
|
||||
bilingual_str error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue