mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName
This commit is contained in:
@@ -49,17 +49,3 @@ void SelectBaseParams(const std::string& chain)
|
||||
{
|
||||
globalChainBaseParams = CreateBaseChainParams(chain);
|
||||
}
|
||||
|
||||
std::string ChainNameFromCommandLine()
|
||||
{
|
||||
bool fRegTest = gArgs.GetBoolArg("-regtest", false);
|
||||
bool fTestNet = gArgs.GetBoolArg("-testnet", false);
|
||||
|
||||
if (fTestNet && fRegTest)
|
||||
throw std::runtime_error("Invalid combination of -regtest and -testnet.");
|
||||
if (fRegTest)
|
||||
return CBaseChainParams::REGTEST;
|
||||
if (fTestNet)
|
||||
return CBaseChainParams::TESTNET;
|
||||
return CBaseChainParams::MAIN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user