aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.h
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2015-05-22 03:50:01 +0200
committerJorge Timón <jtimon@jtimon.cc>2017-05-03 18:15:47 +0200
commitf87f3626e35e7edae37e14f5156809325ad18cb2 (patch)
tree218b637261c6b1a2293539685ca6df1c5e99e933 /src/chainparams.h
parent35da2aeed7d4000dde93957c3b6e048ab83c4f2b (diff)
Chainparams: Use a regular factory for creating chainparams
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