MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / ReadConfigFile

Function ReadConfigFile

src/util.cpp:528–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528void ReadConfigFile(map<string, string>& mapSettingsRet,
529 map<string, vector<string> >& mapMultiSettingsRet)
530{
531 boost::filesystem::ifstream streamConfig(GetConfigFile());
532 if (!streamConfig.good())
533 return; // No bitcoin.conf file is OK
534
535 set<string> setOptions;
536 setOptions.insert("*");
537
538 for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
539 {
540 // Don't overwrite existing settings so command line settings override bitcoin.conf
541 string strKey = string("-") + it->string_key;
542 string strValue = it->value[0];
543 InterpretNegativeSetting(strKey, strValue);
544 if (mapSettingsRet.count(strKey) == 0)
545 mapSettingsRet[strKey] = strValue;
546 mapMultiSettingsRet[strKey].push_back(strValue);
547 }
548 // If datadir is changed in .conf file:
549 ClearDatadirCache();
550}
551
552#ifndef WIN32
553boost::filesystem::path GetPidFile()

Callers 3

AppInitRPCFunction · 0.85
AppInitFunction · 0.85
mainFunction · 0.85

Calls 6

GetConfigFileFunction · 0.85
InterpretNegativeSettingFunction · 0.85
ClearDatadirCacheFunction · 0.85
countMethod · 0.80
insertMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected