aboutsummaryrefslogtreecommitdiff
path: root/src/chainparamsbase.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/chainparamsbase.h
parent35da2aeed7d4000dde93957c3b6e048ab83c4f2b (diff)
downloadbitcoin-f87f3626e35e7edae37e14f5156809325ad18cb2.tar.xz
Chainparams: Use a regular factory for creating chainparams
Diffstat (limited to 'src/chainparamsbase.h')
-rw-r--r--src/chainparamsbase.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h
index 84350cf65b..fc101f5b77 100644
--- a/src/chainparamsbase.h
+++ b/src/chainparamsbase.h
@@ -5,6 +5,7 @@
#ifndef BITCOIN_CHAINPARAMSBASE_H
#define BITCOIN_CHAINPARAMSBASE_H
+#include <memory>
#include <string>
#include <vector>
@@ -31,6 +32,13 @@ protected:
};
/**
+ * 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);