mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs
This commit is contained in:
parent
7b784cc2bb
commit
3450c18a12
6 changed files with 12 additions and 11 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue