mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
ArgsManager: drop m_negated_args
When a -nofoo option is seen, instead of adding it to a separate set of negated args, set the arg as being an empty vector of strings. This changes the behaviour in some ways: - -nofoo=0 still sets foo=1 but no longer treats it as a negated arg - -nofoo=1 -foo=2 has GetArgs() return [2] rather than [2,0] - "foo=2 \n -nofoo=1" in a config file no longer returns [2,0], just [0] - GetArgs returns an empty vector for negated args
This commit is contained in:
@@ -228,7 +228,6 @@ protected:
|
||||
mutable CCriticalSection cs_args;
|
||||
std::map<std::string, std::vector<std::string>> m_override_args;
|
||||
std::map<std::string, std::vector<std::string>> m_config_args;
|
||||
std::unordered_set<std::string> m_negated_args;
|
||||
void ReadConfigStream(std::istream& stream);
|
||||
|
||||
public:
|
||||
@@ -314,11 +313,6 @@ public:
|
||||
* @return CBaseChainParams::MAIN by default; raises runtime error if an invalid combination is given.
|
||||
*/
|
||||
std::string GetChainName() const;
|
||||
|
||||
private:
|
||||
|
||||
// Munge -nofoo into -foo=0 and track the value as negated.
|
||||
void InterpretNegatedOption(std::string &key, std::string &val);
|
||||
};
|
||||
|
||||
extern ArgsManager gArgs;
|
||||
|
||||
Reference in New Issue
Block a user