Move -disableipv4/-disableipv6 parsing to be after -onlynet parsing

This commit is contained in:
Duke
2025-02-18 07:04:10 -05:00
parent 1aebc75d0b
commit b880801235

View File

@@ -1134,22 +1134,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("%s: parameter interaction: -externalip set -> setting -discover=0\n", __func__);
}
if(mapMultiArgs["-disableipv6"].size() > 1) {
return InitError("-disableipv6 can only be used once");
}
if(mapMultiArgs["-disableipv4"].size() > 1) {
return InitError("-disableipv4 can only be used once");
}
if (GetBoolArg("-disableipv6", DEFAULT_DISABLE_IPV6)) {
SetReachable(NET_IPV6, false);
}
if (GetBoolArg("-disableipv4", DEFAULT_DISABLE_IPV4)) {
SetReachable(NET_IPV4, false);
}
// Read asmap file by default for HUSH3 and all Hush Arrakis Chains
if (GetArg("-asmap",1)) {
fs::path asmap_path = fs::path(GetArg("-asmap", ""));
@@ -1679,6 +1663,22 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
if(mapMultiArgs["-disableipv6"].size() > 1) {
return InitError("-disableipv6 can only be used once");
}
if(mapMultiArgs["-disableipv4"].size() > 1) {
return InitError("-disableipv4 can only be used once");
}
if (GetBoolArg("-disableipv6", DEFAULT_DISABLE_IPV6)) {
SetReachable(NET_IPV6, false);
}
if (GetBoolArg("-disableipv4", DEFAULT_DISABLE_IPV4)) {
SetReachable(NET_IPV4, false);
}
//fprintf(stderr,"%s tik19\n", __FUNCTION__);
if (mapArgs.count("-allowlist")) {
BOOST_FOREACH(const std::string& net, mapMultiArgs["-allowlist"]) {