mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName
This commit is contained in:
14
src/util.cpp
14
src/util.cpp
@@ -764,6 +764,20 @@ void ArgsManager::ReadConfigFile(const std::string& confPath)
|
||||
}
|
||||
}
|
||||
|
||||
std::string ArgsManager::GetChainName() const
|
||||
{
|
||||
bool fRegTest = GetBoolArg("-regtest", false);
|
||||
bool fTestNet = 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;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
fs::path GetPidFile()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user