aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/chainparams.h')
-rw-r--r--src/chainparams.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/chainparams.h b/src/chainparams.h
index 4fe88c691c..a91570c22d 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -11,6 +11,7 @@
#include "primitives/block.h"
#include "protocol.h"
+#include <memory>
#include <vector>
struct CDNSSeedData {
@@ -75,6 +76,7 @@ public:
const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
const CCheckpointData& Checkpoints() const { return checkpointData; }
const ChainTxData& TxData() const { return chainTxData; }
+ void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
protected:
CChainParams() {}
@@ -95,6 +97,13 @@ protected:
};
/**
+ * Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
+ * @returns a CChainParams* of the chosen chain.
+ * @throws a std::runtime_error if the chain is not supported.
+ */
+std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain);
+
+/**
* Return the currently selected parameters. This won't change after app
* startup, except for unit tests.
*/
@@ -103,7 +112,7 @@ const CChainParams &Params();
/**
* @returns CChainParams for the given BIP70 chain name.
*/
-CChainParams& Params(const std::string& chain);
+const CChainParams& Params(const std::string& chain);
/**
* Sets the params returned by Params() to those for the given BIP70 chain name.
@@ -114,6 +123,6 @@ void SelectParams(const std::string& chain);
/**
* Allows modifying the BIP9 regtest parameters.
*/
-void UpdateRegtestBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
+void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
#endif // BITCOIN_CHAINPARAMS_H