| 673 | } |
| 674 | |
| 675 | void 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 | |
| 695 | fs::path GetPidFile() { |
| 696 | fs::path pathPidFile(SysCfg().GetArg("-pid", "coind.pid")); |
no test coverage detected