Skip to content

Commit 3429d67

Browse files
committed
init: Prevent -noproxy and -proxy=0 settings from interacting with other settings
Prevent -noproxy and -proxy=0 settings from interacting with -listen, -upnp, and -natpmp settings. These settings started being handled inconsistently in the `AppInitMain` and `InitParameterInteraction` functions starting in commit baf0507 from #6272: https://github.com/bitcoin/bitcoin/blob/baf05075fae2cc2625a2a74b35cc66902f3cbfa3/src/init.cpp#L990-L991 https://github.com/bitcoin/bitcoin/blob/baf05075fae2cc2625a2a74b35cc66902f3cbfa3/src/init.cpp#L687 This commit changes both functions to handle proxy arguments the same way so there are not side effects from specifying a proxy=0 setting.
1 parent 2b5a741 commit 3429d67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,8 @@ void InitParameterInteraction(ArgsManager& args)
660660
LogPrintf("%s: parameter interaction: -connect set -> setting -listen=0\n", __func__);
661661
}
662662

663-
if (args.IsArgSet("-proxy")) {
663+
std::string proxy_arg = args.GetArg("-proxy", "");
664+
if (proxy_arg != "" && proxy_arg != "0") {
664665
// to protect privacy, do not listen by default if a default proxy server is specified
665666
if (args.SoftSetBoolArg("-listen", false))
666667
LogPrintf("%s: parameter interaction: -proxy set -> setting -listen=0\n", __func__);

0 commit comments

Comments
 (0)