mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Chainparams: Use a regular factory for creating chainparams
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#ifndef BITCOIN_CHAINPARAMSBASE_H
|
||||
#define BITCOIN_CHAINPARAMSBASE_H
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -30,6 +31,13 @@ protected:
|
||||
std::string strDataDir;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
|
||||
* @returns a CBaseChainParams* of the chosen chain.
|
||||
* @throws a std::runtime_error if the chain is not supported.
|
||||
*/
|
||||
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain);
|
||||
|
||||
/**
|
||||
* Append the help messages for the chainparams options to the
|
||||
* parameter string.
|
||||
@@ -42,8 +50,6 @@ void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp=true);
|
||||
*/
|
||||
const CBaseChainParams& BaseParams();
|
||||
|
||||
CBaseChainParams& BaseParams(const std::string& chain);
|
||||
|
||||
/** Sets the params returned by Params() to those for the given network. */
|
||||
void SelectBaseParams(const std::string& chain);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user