aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2019-04-22 18:08:51 -0400
committerRussell Yanofsky <russ@yanofsky.org>2019-11-07 23:08:22 -0400
commit7f40528cd50fc43ac0bd3e785de24d661adddb7a (patch)
treea687d73e4cc320c7c4dee5dd96b1f99ce21c2122 /src/util/system.h
parent9dcb952fe5f85529ab28e091af7534e72c21c90f (diff)
downloadbitcoin-7f40528cd50fc43ac0bd3e785de24d661adddb7a.tar.xz
Deduplicate settings merge code
Get rid of settings merging code in util/system.cpp repeated 5 places, inconsistently: - ArgsManagerHelper::GetArg - ArgsManagerHelper::GetNetBoolArg - ArgsManager::GetArgs - ArgsManager::IsArgNegated - ArgsManager::GetUnsuitableSectionOnlyArgs Having settings merging code separated from parsing simplifies parsing somewhat (for example negated values can simply be represented as false values instead of partially cleared or emply placeholder lists). Having settings merge happen one place instead of 5 makes it easier to add new settings sources and harder to introduce new inconsistencies in the way settings are merged. This commit does not change behavior in any way.
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/system.h b/src/util/system.h
index 7452f186e6..e0b6371dc9 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -22,6 +22,7 @@
#include <sync.h>
#include <tinyformat.h>
#include <util/memory.h>
+#include <util/settings.h>
#include <util/threadnames.h>
#include <util/time.h>
@@ -157,8 +158,7 @@ protected:
};
mutable CCriticalSection cs_args;
- std::map<std::string, std::vector<std::string>> m_override_args GUARDED_BY(cs_args);
- std::map<std::string, std::vector<std::string>> m_config_args GUARDED_BY(cs_args);
+ util::Settings m_settings GUARDED_BY(cs_args);
std::string m_network GUARDED_BY(cs_args);
std::set<std::string> m_network_only_args GUARDED_BY(cs_args);
std::map<OptionsCategory, std::map<std::string, Arg>> m_available_args GUARDED_BY(cs_args);