From 02395edca9e99454388ae9b91ee174fbccc38021 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 14 Nov 2023 16:39:59 +0000 Subject: [PATCH 1/2] init: remove redundant upnp #ifdef --- src/init.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index d6dc62f707..1586ab2632 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -519,11 +519,7 @@ void SetupServerArgs(ArgsManager& argsman) argsman.AddArg("-torcontrol=:", strprintf("Tor control host and port to use if onion listening enabled (default: %s). If no port is specified, the default port of %i will be used.", DEFAULT_TOR_CONTROL, DEFAULT_TOR_CONTROL_PORT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-torpassword=", "Tor control port password (default: empty)", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::CONNECTION); #ifdef USE_UPNP -#if USE_UPNP - argsman.AddArg("-upnp", "Use UPnP to map the listening port (default: 1 when listening and no -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); -#else - argsman.AddArg("-upnp", strprintf("Use UPnP to map the listening port (default: %u)", 0), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); -#endif + argsman.AddArg("-upnp", strprintf("Use UPnP to map the listening port (default: %u)", DEFAULT_UPNP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); #else hidden_args.emplace_back("-upnp"); #endif From 92f88a962908c49dde99c03a4608e63e4a6eec71 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 14 Nov 2023 16:41:06 +0000 Subject: [PATCH 2/2] doc: fixup NAT-PMP help doc This always defaults to false, since we removed the compile time options to set it otherwise. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 1586ab2632..9c7ffe28ee 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -524,7 +524,7 @@ void SetupServerArgs(ArgsManager& argsman) hidden_args.emplace_back("-upnp"); #endif #ifdef USE_NATPMP - argsman.AddArg("-natpmp", strprintf("Use NAT-PMP to map the listening port (default: %s)", DEFAULT_NATPMP ? "1 when listening and no -proxy" : "0"), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); + argsman.AddArg("-natpmp", strprintf("Use NAT-PMP to map the listening port (default: %u)", DEFAULT_NATPMP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); #else hidden_args.emplace_back("-natpmp"); #endif // USE_NATPMP