Skip to content

Commit 2074d7d

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24837: init: Prevent -noproxy and -proxy=0 from interacting with other settings
3429d67 init: Prevent -noproxy and -proxy=0 settings from interacting with other settings (Ryan Ofsky) Pull request description: 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. This change was originally part of #24830 but really is independent and makes more sense as a separate PR ACKs for top commit: hebasto: ACK 3429d67, tested on Ubuntu 22.04. Tree-SHA512: c4c6b4aeb3c07321700e974c16fd47a1bd3d469f273a6b308a69638db81c88c4e67208fddc96fcda9c8bd85f3ae22c98ca131c9622895edaa34eb65c194f35db
2 parents d1b3dfb + 3429d67 commit 2074d7d

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)