ReadConfigStream: assume the stream is good
This commit is contained in:
parent
6d5815aad0
commit
087c5d2040
1 changed files with 17 additions and 17 deletions
10
src/util.cpp
10
src/util.cpp
|
@ -737,11 +737,8 @@ fs::path GetConfigFile(const std::string& confPath)
|
||||||
|
|
||||||
void ArgsManager::ReadConfigStream(std::istream& stream)
|
void ArgsManager::ReadConfigStream(std::istream& stream)
|
||||||
{
|
{
|
||||||
if (!stream.good())
|
|
||||||
return; // No bitcoin.conf file is OK
|
|
||||||
|
|
||||||
{
|
|
||||||
LOCK(cs_args);
|
LOCK(cs_args);
|
||||||
|
|
||||||
std::set<std::string> setOptions;
|
std::set<std::string> setOptions;
|
||||||
setOptions.insert("*");
|
setOptions.insert("*");
|
||||||
|
|
||||||
|
@ -755,13 +752,16 @@ void ArgsManager::ReadConfigStream(std::istream& stream)
|
||||||
mapArgs[strKey] = strValue;
|
mapArgs[strKey] = strValue;
|
||||||
mapMultiArgs[strKey].push_back(strValue);
|
mapMultiArgs[strKey].push_back(strValue);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArgsManager::ReadConfigFile(const std::string& confPath)
|
void ArgsManager::ReadConfigFile(const std::string& confPath)
|
||||||
{
|
{
|
||||||
fs::ifstream stream(GetConfigFile(confPath));
|
fs::ifstream stream(GetConfigFile(confPath));
|
||||||
|
|
||||||
|
// ok to not have a config file
|
||||||
|
if (stream.good()) {
|
||||||
ReadConfigStream(stream);
|
ReadConfigStream(stream);
|
||||||
|
}
|
||||||
|
|
||||||
// If datadir is changed in .conf file:
|
// If datadir is changed in .conf file:
|
||||||
ClearDatadirCache();
|
ClearDatadirCache();
|
||||||
|
|
Loading…
Reference in a new issue