aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2016-09-28 10:10:15 +0200
committerJorge Timón <jtimon@jtimon.cc>2016-10-01 08:12:19 +0200
commit3450c18a125f125aec76bfef79c69317eaad935d (patch)
treed41fdcefaab3cc63947a22d3960b22107cbb35f8 /src/util.cpp
parent7b784cc2bbcdc90361add2adb657c58162aca4ef (diff)
downloadbitcoin-3450c18a125f125aec76bfef79c69317eaad935d.tar.xz
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 93cc0412b5..c20ede6221 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -518,19 +518,20 @@ void ClearDatadirCache()
pathCachedNetSpecific = boost::filesystem::path();
}
-boost::filesystem::path GetConfigFile()
+boost::filesystem::path GetConfigFile(const std::string& confPath)
{
- boost::filesystem::path pathConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
+ boost::filesystem::path pathConfigFile(confPath);
if (!pathConfigFile.is_complete())
pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
}
-void ReadConfigFile(map<string, string>& mapSettingsRet,
+void ReadConfigFile(const std::string& confPath,
+ map<string, string>& mapSettingsRet,
map<string, vector<string> >& mapMultiSettingsRet)
{
- boost::filesystem::ifstream streamConfig(GetConfigFile());
+ boost::filesystem::ifstream streamConfig(GetConfigFile(confPath));
if (!streamConfig.good())
return; // No bitcoin.conf file is OK