HomePhabricator

init: Allow -proxy="" setting values

Description

init: Allow -proxy="" setting values

Summary:
This drops the No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>
error when a empty -proxy= command line argument, bitcoin.conf value, or
settings.json value is specified, and just makes bitcoin connect and listen
normally in these cases.

The error was originally added in https://github.com/bitcoin/bitcoin/pull/20003
to prevent a bare -proxy command line argument with no assignment from
clearing proxy settings. But it was implemented in an overbroad way breaking
empty -proxy= assignments as well.

The motivation for this change is to prevent a GUI bug that happens with
https://github.com/bitcoin/bitcoin/pull/15936, reported in
https://github.com/bitcoin/bitcoin/pull/15936#pullrequestreview-937685759 by
vasild, that happens after a proxy setting is enabled and disabled in the GUI.
But this change also makes sense on its own to remove a potentially confusing
error message.

See D4496 and D8637 for changes related to ParseKeyValue

This concludes backport of core#24830
Depends on D18260

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18261

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Apr 12 2022, 07:00
PiRKCommitted on Jun 17 2025, 19:17
PiRKPushed on Jun 17 2025, 19:17
Reviewer
Restricted Project
Differential Revision
D18261: init: Allow -proxy="" setting values
Parents
rABCa9a87d3a9967: refactor: Add explicit DISALLOW_NEGATION ArgsManager flag to clarify flag usage
Branches
Unknown
Tags
Unknown