0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

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
baf05075fa from #6272:

baf05075fa/src/init.cpp (L990-L991)
baf05075fa/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.
This commit is contained in:
Ryan Ofsky 2022-04-12 03:00:28 -04:00
parent 2b5a741e98
commit 3429d67014

View file

@ -660,7 +660,8 @@ void InitParameterInteraction(ArgsManager& args)
LogPrintf("%s: parameter interaction: -connect set -> setting -listen=0\n", __func__);
}
if (args.IsArgSet("-proxy")) {
std::string proxy_arg = args.GetArg("-proxy", "");
if (proxy_arg != "" && proxy_arg != "0") {
// to protect privacy, do not listen by default if a default proxy server is specified
if (args.SoftSetBoolArg("-listen", false))
LogPrintf("%s: parameter interaction: -proxy set -> setting -listen=0\n", __func__);