mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-29 16:24:22 +00:00
SQUASHME: NetworkIdFromCommandLine() function instead of method
This commit is contained in:
parent
3fdb9e8c15
commit
b796cb084b
@ -242,7 +242,7 @@ void SelectParams(CBaseChainParams::Network network) {
|
||||
|
||||
bool SelectParamsFromCommandLine()
|
||||
{
|
||||
CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine();
|
||||
CBaseChainParams::Network network = NetworkIdFromCommandLine();
|
||||
if (network == CBaseChainParams::MAX_NETWORK_TYPES)
|
||||
return false;
|
||||
|
||||
|
@ -83,23 +83,23 @@ void SelectBaseParams(CBaseChainParams::Network network)
|
||||
}
|
||||
}
|
||||
|
||||
CBaseChainParams::Network CBaseChainParams::NetworkIdFromCommandLine()
|
||||
CBaseChainParams::Network NetworkIdFromCommandLine()
|
||||
{
|
||||
bool fRegTest = GetBoolArg("-regtest", false);
|
||||
bool fTestNet = GetBoolArg("-testnet", false);
|
||||
|
||||
if (fTestNet && fRegTest)
|
||||
return MAX_NETWORK_TYPES;
|
||||
return CBaseChainParams::MAX_NETWORK_TYPES;
|
||||
if (fRegTest)
|
||||
return REGTEST;
|
||||
return CBaseChainParams::REGTEST;
|
||||
if (fTestNet)
|
||||
return TESTNET;
|
||||
return MAIN;
|
||||
return CBaseChainParams::TESTNET;
|
||||
return CBaseChainParams::MAIN;
|
||||
}
|
||||
|
||||
bool SelectBaseParamsFromCommandLine()
|
||||
{
|
||||
CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine();
|
||||
CBaseChainParams::Network network = NetworkIdFromCommandLine();
|
||||
if (network == CBaseChainParams::MAX_NETWORK_TYPES)
|
||||
return false;
|
||||
|
||||
|
@ -26,11 +26,6 @@ public:
|
||||
const std::string& DataDir() const { return strDataDir; }
|
||||
int RPCPort() const { return nRPCPort; }
|
||||
|
||||
/**
|
||||
* Looks for -regtest or -testnet and returns the appropriate Network ID.
|
||||
* Returns MAX_NETWORK_TYPES if an invalid combination is given.
|
||||
*/
|
||||
static Network NetworkIdFromCommandLine();
|
||||
protected:
|
||||
CBaseChainParams() {}
|
||||
|
||||
@ -49,7 +44,13 @@ const CBaseChainParams& BaseParams();
|
||||
void SelectBaseParams(CBaseChainParams::Network network);
|
||||
|
||||
/**
|
||||
* Calls CBaseChainParams::NetworkIdFromCommandLine() and then calls SelectParams as appropriate.
|
||||
* Looks for -regtest or -testnet and returns the appropriate Network ID.
|
||||
* Returns MAX_NETWORK_TYPES if an invalid combination is given.
|
||||
*/
|
||||
CBaseChainParams::Network NetworkIdFromCommandLine();
|
||||
|
||||
/**
|
||||
* Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate.
|
||||
* Returns false if an invalid combination is given.
|
||||
*/
|
||||
bool SelectBaseParamsFromCommandLine();
|
||||
|
Loading…
x
Reference in New Issue
Block a user