Make negating options the same as not setting them for -norpcwhitelist
, -norpcallowip
, -norpcbind
, -nobind
, -nowhitebind
, -noexternalip
, -noonlynet
, -noseednode
, -nosignetchallenge
, -nosignetseednode
, -notest
, and -norpcwallet
options, instead of triggering confusing side effects and errors, like -norpcwallet
trying to make RPC calls to the “0” wallet.
The first 3 commits just clean up code without changing behavior: adding tests and documentation and clarifying code.
The last 2 commits change handling of negated options to avoid nonsensical behavior. The idea is to treat most negated options the same as unspecified options by avoiding or working around IsArgSet()
calls which return false for unspecified options but true for negated ones. The specific changes are described in the commit messages.
These changes were originally part of #17783, which adds enforcement that IsArgSet()
cannot be called on list options, so similar problems do not happen in the future. But progress on #17783 was slower than expected, so it seems good to improve current behavior and documentation while stricter checking is being worked on in #17783.