Changeset View
Changeset View
Standalone View
Standalone View
src/chainparamsbase.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | else | ||||
strprintf("%s: Unknown chain %s.", __func__, chain)); | strprintf("%s: Unknown chain %s.", __func__, chain)); | ||||
} | } | ||||
void SelectBaseParams(const std::string &chain) { | void SelectBaseParams(const std::string &chain) { | ||||
pCurrentBaseParams = &BaseParams(chain); | pCurrentBaseParams = &BaseParams(chain); | ||||
} | } | ||||
std::string ChainNameFromCommandLine() { | std::string ChainNameFromCommandLine() { | ||||
bool fRegTest = GetBoolArg("-regtest", false); | bool fRegTest = gArgs.GetBoolArg("-regtest", false); | ||||
bool fTestNet = GetBoolArg("-testnet", false); | bool fTestNet = gArgs.GetBoolArg("-testnet", false); | ||||
if (fTestNet && fRegTest) | if (fTestNet && fRegTest) | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"Invalid combination of -regtest and -testnet."); | "Invalid combination of -regtest and -testnet."); | ||||
if (fRegTest) return CBaseChainParams::REGTEST; | if (fRegTest) return CBaseChainParams::REGTEST; | ||||
if (fTestNet) return CBaseChainParams::TESTNET; | if (fTestNet) return CBaseChainParams::TESTNET; | ||||
return CBaseChainParams::MAIN; | return CBaseChainParams::MAIN; | ||||
} | } | ||||
bool AreBaseParamsConfigured() { | bool AreBaseParamsConfigured() { | ||||
return pCurrentBaseParams != nullptr; | return pCurrentBaseParams != nullptr; | ||||
} | } |