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

Function ReadConfigFile

src/commons/util/util.cpp:675–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675void ReadConfigFile(map<string, string>& mapSettingsRet, map<string, vector<string>>& mapMultiSettingsRet) {
676 fs::ifstream streamConfig(GetConfigFile());
677 if (!streamConfig.good())
678 return; // No WaykiChain.conf file is OK
679
680 set<string> setOptions;
681 setOptions.insert("*");
682
683 for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it) {
684 // Don't overwrite existing settings so command line settings override WaykiChain.conf
685 string strKey = strprintf("-%s", it->string_key);
686 if (mapSettingsRet.count(strKey) == 0)
687 mapSettingsRet[strKey] = it->value[0];
688
689 mapMultiSettingsRet[strKey].push_back(it->value[0]);
690 }
691 // If datadir is changed in .conf file:
692 ClearDatadirCache();
693}
694
695fs::path GetPidFile() {
696 fs::path pathPidFile(SysCfg().GetArg("-pid", "coind.pid"));

Callers 1

Calls 6

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

Tested by

no test coverage detected