diff options
author | Matt Corallo <git@bluematt.me> | 2016-11-29 15:17:34 -0800 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2016-12-23 21:30:15 -0500 |
commit | c8042a48f01aaf306e108683e40db4bfaf0bbcaa (patch) | |
tree | 8baf9690b4ab0628b7f3795d24dbab85dcac0374 | |
parent | 0f921e6a0492c4e9f037a9ed91f474885032d68c (diff) |
Remove arguments to ParseConfigFile
-rw-r--r-- | src/bitcoin-cli.cpp | 2 | ||||
-rw-r--r-- | src/bitcoind.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 2 | ||||
-rw-r--r-- | src/util.cpp | 10 | ||||
-rw-r--r-- | src/util.h | 2 |
5 files changed, 8 insertions, 10 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 596cc8eada..cee9ae31b5 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -99,7 +99,7 @@ static int AppInitRPC(int argc, char* argv[]) return EXIT_FAILURE; } try { - ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs); + ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME)); } catch (const std::exception& e) { fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return EXIT_FAILURE; diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index ba3ccac615..3dd0856289 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -104,7 +104,7 @@ bool AppInit(int argc, char* argv[]) } try { - ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs); + ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME)); } catch (const std::exception& e) { fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index cfd0955a74..3ae54f3119 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -608,7 +608,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } try { - ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs); + ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME)); } catch (const std::exception& e) { QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); diff --git a/src/util.cpp b/src/util.cpp index 977f8993ed..8b3e5f93f0 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -526,9 +526,7 @@ boost::filesystem::path GetConfigFile(const std::string& confPath) return pathConfigFile; } -void ReadConfigFile(const std::string& confPath, - map<string, string>& mapSettingsRet, - map<string, vector<string> >& mapMultiSettingsRet) +void ReadConfigFile(const std::string& confPath) { boost::filesystem::ifstream streamConfig(GetConfigFile(confPath)); if (!streamConfig.good()) @@ -543,9 +541,9 @@ void ReadConfigFile(const std::string& confPath, string strKey = string("-") + it->string_key; string strValue = it->value[0]; InterpretNegativeSetting(strKey, strValue); - if (mapSettingsRet.count(strKey) == 0) - mapSettingsRet[strKey] = strValue; - mapMultiSettingsRet[strKey].push_back(strValue); + if (mapArgs.count(strKey) == 0) + mapArgs[strKey] = strValue; + mapMultiArgs[strKey].push_back(strValue); } // If datadir is changed in .conf file: ClearDatadirCache(); diff --git a/src/util.h b/src/util.h index 3ec38a7c7d..4fb09046bd 100644 --- a/src/util.h +++ b/src/util.h @@ -106,7 +106,7 @@ boost::filesystem::path GetConfigFile(const std::string& confPath); boost::filesystem::path GetPidFile(); void CreatePidFile(const boost::filesystem::path &path, pid_t pid); #endif -void ReadConfigFile(const std::string& confPath, std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet); +void ReadConfigFile(const std::string& confPath); #ifdef WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif |