Dash Core  0.12.2.1
P2P Digital Currency
chainparamsbase.cpp File Reference
#include "chainparamsbase.h"
#include "tinyformat.h"
#include "util.h"
#include <assert.h>

Go to the source code of this file.

Classes

class  CBaseMainParams
 
class  CBaseTestNetParams
 
class  CBaseRegTestParams
 

Functions

void AppendParamsHelpMessages (std::string &strUsage, bool debugHelp)
 
const CBaseChainParamsBaseParams ()
 
CBaseChainParamsBaseParams (const std::string &chain)
 
void SelectBaseParams (const std::string &chain)
 
std::string ChainNameFromCommandLine ()
 
bool AreBaseParamsConfigured ()
 

Variables

static CBaseMainParams mainParams
 
static CBaseTestNetParams testNetParams
 
static CBaseRegTestParams regTestParams
 
static CBaseChainParamspCurrentBaseParams = 0
 

Function Documentation

◆ AppendParamsHelpMessages()

void AppendParamsHelpMessages ( std::string &  strUsage,
bool  debugHelp = true 
)

Append the help messages for the chainparams options to the parameter string.

Definition at line 17 of file chainparamsbase.cpp.

Referenced by AppInitRawTx(), HelpMessage(), and HelpMessageCli().

◆ AreBaseParamsConfigured()

bool AreBaseParamsConfigured ( )

Return true if SelectBaseParamsFromCommandLine() has been called to select a network.

Definition at line 107 of file chainparamsbase.cpp.

◆ BaseParams() [1/2]

const CBaseChainParams& BaseParams ( )

Return the currently selected parameters. This won't change after app startup, except for unit tests.

Definition at line 70 of file chainparamsbase.cpp.

Referenced by CallRPC(), GetDataDir(), HelpMessage(), HelpMessageCli(), HTTPBindAddresses(), and SelectBaseParams().

◆ BaseParams() [2/2]

CBaseChainParams& BaseParams ( const std::string &  chain)

Definition at line 76 of file chainparamsbase.cpp.

◆ ChainNameFromCommandLine()

std::string ChainNameFromCommandLine ( )

Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.

Returns
CBaseChainParams::MAX_NETWORK_TYPES if an invalid combination is given. CBaseChainParams::MAIN by default.

Definition at line 93 of file chainparamsbase.cpp.

Referenced by AppInit(), AppInitRawTx(), AppInitRPC(), and main().

◆ SelectBaseParams()

void SelectBaseParams ( const std::string &  chain)

Sets the params returned by Params() to those for the given network.

Definition at line 88 of file chainparamsbase.cpp.

Referenced by AppInitRPC(), and SelectParams().

Variable Documentation

◆ mainParams

CBaseMainParams mainParams
static

Definition at line 38 of file chainparamsbase.cpp.

Referenced by BaseParams().

◆ pCurrentBaseParams

CBaseChainParams* pCurrentBaseParams = 0
static

Definition at line 68 of file chainparamsbase.cpp.

Referenced by AreBaseParamsConfigured(), BaseParams(), and SelectBaseParams().

◆ regTestParams

CBaseRegTestParams regTestParams
static

Definition at line 66 of file chainparamsbase.cpp.

Referenced by BaseParams().

◆ testNetParams

CBaseTestNetParams testNetParams
static

Definition at line 52 of file chainparamsbase.cpp.

Referenced by BaseParams().