init: Prevent -noproxy and -proxy=0 from interacting with other settings #24837

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/proxyi changing 1 files +2 −1
  1. ryanofsky commented at 6:15 PM on April 12, 2022: member

    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 baf05075fae2cc2625a2a74b35cc66902f3cbfa3 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

  2. 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
    baf05075fae2cc2625a2a74b35cc66902f3cbfa3 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.
    3429d67014
  3. in src/init.cpp:664 in 3429d67014
     659 | @@ -660,7 +660,8 @@ void InitParameterInteraction(ArgsManager& args)
     660 |              LogPrintf("%s: parameter interaction: -connect set -> setting -listen=0\n", __func__);
     661 |      }
     662 |  
     663 | -    if (args.IsArgSet("-proxy")) {
     664 | +    std::string proxy_arg = args.GetArg("-proxy", "");
     665 | +    if (proxy_arg != "" && proxy_arg != "0") {
    


    ryanofsky commented at 6:18 PM on April 12, 2022:

    In commit "init: Prevent -noproxy and -proxy=0 settings from interacting with other settings" (3429d67014095b42a976d95c3ef8622d5fe085e6)

    These lines are copied from AppInitMain below


    luke-jr commented at 2:33 AM on April 13, 2022:
        if (args.GetBoolArg("-proxy")) {
    

    luke-jr commented at 2:34 AM on April 13, 2022:

    Nevermind, this can do the wrong thing if a long decimal IP is specified.

  4. luke-jr approved
  5. luke-jr commented at 2:36 AM on April 13, 2022: member

    utACK

  6. hebasto approved
  7. hebasto commented at 12:31 PM on April 13, 2022: member

    ACK 3429d67014095b42a976d95c3ef8622d5fe085e6, tested on Ubuntu 22.04.

  8. MarcoFalke merged this on Apr 17, 2022
  9. MarcoFalke closed this on Apr 17, 2022

  10. sidhujag referenced this in commit 291694c25f on Apr 18, 2022
  11. DrahtBot locked this on Apr 17, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me