Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir)

This commit is contained in:
Jorge Timón
2015-06-30 21:39:49 +02:00
parent 49793fbb09
commit f3525e24e3
6 changed files with 48 additions and 45 deletions

View File

@@ -103,11 +103,16 @@ protected:
*/
const CChainParams &Params();
/** Return parameters for the given network. */
CChainParams &Params(CBaseChainParams::Network network);
/**
* @returns CChainParams for the given BIP70 chain name.
*/
CChainParams& Params(const std::string& chain);
/** Sets the params returned by Params() to those for the given network. */
void SelectParams(CBaseChainParams::Network network);
/**
* Sets the params returned by Params() to those for the given BIP70 chain name.
* @throws std::runtime_error when the chain is not supported.
*/
void SelectParams(const std::string& chain);
/**
* Looks for -regtest or -testnet and then calls SelectParams as appropriate.