aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2017-05-06 21:23:21 +0200
committerJorge Timón <jtimon@jtimon.cc>2017-05-09 21:37:29 +0200
commit52922456b86b98ea89b1deb672e1b5ac506c1ba3 (patch)
treeb38ad887f6aa0b082c02033824b2ca7511171cf2 /src/util.cpp
parentb3cbd554d90815725988f3810929f2450702a717 (diff)
Util: Put mapMultiArgs inside ArgsManager
- Set ArgsManager::mapMultiArgs in ArgsManager::SoftSetArg, ForceSetArg, SoftSetBoolArg
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/util.cpp b/src/util.cpp
index d8bdd3c69e..2f0f846291 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -92,8 +92,6 @@ const char * const BITCOIN_CONF_FILENAME = "bitcoin.conf";
const char * const BITCOIN_PID_FILENAME = "bitcoind.pid";
ArgsManager gArgs;
-static std::map<std::string, std::vector<std::string> > _mapMultiArgs;
-const std::map<std::string, std::vector<std::string> >& mapMultiArgs = _mapMultiArgs;
bool fPrintToConsole = false;
bool fPrintToDebugLog = true;
@@ -386,7 +384,7 @@ void ArgsManager::ParseParameters(int argc, const char* const argv[])
{
LOCK(cs_args);
mapArgs.clear();
- _mapMultiArgs.clear();
+ mapMultiArgs.clear();
for (int i = 1; i < argc; i++)
{
@@ -414,7 +412,7 @@ void ArgsManager::ParseParameters(int argc, const char* const argv[])
InterpretNegativeSetting(str, strValue);
mapArgs[str] = strValue;
- _mapMultiArgs[str].push_back(strValue);
+ mapMultiArgs[str].push_back(strValue);
}
}
@@ -459,7 +457,7 @@ bool ArgsManager::SoftSetArg(const std::string& strArg, const std::string& strVa
LOCK(cs_args);
if (mapArgs.count(strArg))
return false;
- mapArgs[strArg] = strValue;
+ ForceSetArg(strArg, strValue);
return true;
}
@@ -475,6 +473,7 @@ void ArgsManager::ForceSetArg(const std::string& strArg, const std::string& strV
{
LOCK(cs_args);
mapArgs[strArg] = strValue;
+ mapMultiArgs[strArg].push_back(strValue);
}
@@ -612,7 +611,7 @@ void ArgsManager::ReadConfigFile(const std::string& confPath)
InterpretNegativeSetting(strKey, strValue);
if (mapArgs.count(strKey) == 0)
mapArgs[strKey] = strValue;
- _mapMultiArgs[strKey].push_back(strValue);
+ mapMultiArgs[strKey].push_back(strValue);
}
}
// If datadir is changed in .conf file: