Changeset View
Changeset View
Standalone View
Standalone View
src/util.cpp
Show First 20 Lines • Show All 471 Lines • ▼ Show 20 Lines | void ArgsManager::ReadConfigFile(const std::string &confPath) { | ||||
// ok to not have a config file | // ok to not have a config file | ||||
if (stream.good()) { | if (stream.good()) { | ||||
ReadConfigStream(stream); | ReadConfigStream(stream); | ||||
} | } | ||||
// If datadir is changed in .conf file: | // If datadir is changed in .conf file: | ||||
ClearDatadirCache(); | ClearDatadirCache(); | ||||
if (!fs::is_directory(GetDataDir(false))) { | |||||
throw std::runtime_error( | |||||
strprintf("specified data directory \"%s\" does not exist.", | |||||
gArgs.GetArg("-datadir", "").c_str())); | |||||
} | |||||
} | } | ||||
std::string ArgsManager::GetChainName() const { | std::string ArgsManager::GetChainName() const { | ||||
bool fRegTest = GetBoolArg("-regtest", false); | bool fRegTest = GetBoolArg("-regtest", false); | ||||
bool fTestNet = GetBoolArg("-testnet", false); | bool fTestNet = GetBoolArg("-testnet", false); | ||||
if (fTestNet && fRegTest) { | if (fTestNet && fRegTest) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |