| 526 | } |
| 527 | |
| 528 | void 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 |
| 553 | boost::filesystem::path GetPidFile() |
no test coverage detected