The PR changes behavior of negated -noseednode
, -nobind
, -nowhitebind
, -norpcbind
, -norpcallowip
, -norpcwhitelist
, -notest
, -noasmap
, -norpcwallet
, -noonlynet
, and -noexternalip
options, so negating these options just clears previously specified values doesn’t have other side effects.
Negating options on the command line can be a useful way of resetting options that may have been set earlier in the command line or config file. But before this change, negating these options wouldn’t fully reset them, and would have confusing and undocumented side effects (see commit descriptions for details). Now, negating these options just resets them and behaves the same as not specifying them.
Motivation for this PR is to fix confusing behaviors and also to remove incorrect usages of the IsArgSet()
function. Using IsArgSet()
tends to lead to negated option bugs in general, but it especially causes bugs when used with list settings returned by GetArgs()
, because when these settings are negated, IsArgSet()
will return true but GetArgs()
will return an empty list. This PR eliminates all uses of IsArgSet()
and GetArgs()
together, and followup PR #17783 makes it an error to use IsArgSet()
on list settings, since calling IsArgSet()
is never actually necessary. Most of the changes here were originally made in #17783 and then moved here to be easier to review and avoid a dependency on #16545.