|
|
|
@ -83,22 +83,27 @@ void SelectBaseParams(CBaseChainParams::Network network)
@@ -83,22 +83,27 @@ void SelectBaseParams(CBaseChainParams::Network network)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool SelectBaseParamsFromCommandLine() |
|
|
|
|
CBaseChainParams::Network CBaseChainParams::NetworkIdFromCommandLine() |
|
|
|
|
{ |
|
|
|
|
bool fRegTest = GetBoolArg("-regtest", false); |
|
|
|
|
bool fTestNet = GetBoolArg("-testnet", false); |
|
|
|
|
|
|
|
|
|
if (fTestNet && fRegTest) { |
|
|
|
|
if (fTestNet && fRegTest) |
|
|
|
|
return MAX_NETWORK_TYPES; |
|
|
|
|
if (fRegTest) |
|
|
|
|
return REGTEST; |
|
|
|
|
if (fTestNet) |
|
|
|
|
return TESTNET; |
|
|
|
|
return MAIN; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool SelectBaseParamsFromCommandLine() |
|
|
|
|
{ |
|
|
|
|
CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); |
|
|
|
|
if (network == CBaseChainParams::MAX_NETWORK_TYPES) |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (fRegTest) { |
|
|
|
|
SelectBaseParams(CBaseChainParams::REGTEST); |
|
|
|
|
} else if (fTestNet) { |
|
|
|
|
SelectBaseParams(CBaseChainParams::TESTNET); |
|
|
|
|
} else { |
|
|
|
|
SelectBaseParams(CBaseChainParams::MAIN); |
|
|
|
|
} |
|
|
|
|
SelectBaseParams(network); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|