mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge pull request #4804 from jtimon/chainparams3
Remove CBaseChainParams::NetworkID()
This commit is contained in:
commit
494ff05a4c
4 changed files with 34 additions and 23 deletions
|
|
@ -100,22 +100,27 @@ void SelectBaseParams(CBaseChainParams::Network network)
|
|||
}
|
||||
}
|
||||
|
||||
bool SelectBaseParamsFromCommandLine()
|
||||
CBaseChainParams::Network NetworkIdFromCommandLine()
|
||||
{
|
||||
bool fRegTest = GetBoolArg("-regtest", false);
|
||||
bool fTestNet = GetBoolArg("-testnet", false);
|
||||
|
||||
if (fTestNet && fRegTest) {
|
||||
return false;
|
||||
}
|
||||
if (fTestNet && fRegTest)
|
||||
return CBaseChainParams::MAX_NETWORK_TYPES;
|
||||
if (fRegTest)
|
||||
return CBaseChainParams::REGTEST;
|
||||
if (fTestNet)
|
||||
return CBaseChainParams::TESTNET;
|
||||
return CBaseChainParams::MAIN;
|
||||
}
|
||||
|
||||
if (fRegTest) {
|
||||
SelectBaseParams(CBaseChainParams::REGTEST);
|
||||
} else if (fTestNet) {
|
||||
SelectBaseParams(CBaseChainParams::TESTNET);
|
||||
} else {
|
||||
SelectBaseParams(CBaseChainParams::MAIN);
|
||||
}
|
||||
bool SelectBaseParamsFromCommandLine()
|
||||
{
|
||||
CBaseChainParams::Network network = NetworkIdFromCommandLine();
|
||||
if (network == CBaseChainParams::MAX_NETWORK_TYPES)
|
||||
return false;
|
||||
|
||||
SelectBaseParams(network);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue