aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.h
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-03-10 17:21:05 -0500
committerTheCharlatan <seb.kung@gmail.com>2023-03-15 16:43:29 +0100
commitedabbc78a3bc272b2b802e1dbab73d6ed8e31e96 (patch)
treed72d36d2223e62db192710b4efa44155b6a61a6d /src/chainparams.h
parentd938098398814f37fed9b018b44716179cfa4b03 (diff)
Add factory functions for Main/Test/Sig/Reg chainparams
This normalizes the behavior of initializing Main/Test/Sig/Reg chainparams with RegTest/SigNet chainparams. These factory functions can also easily be used from a context without an instantiated ArgsManager, e.g. from libbitcoin kernel code, unlike the existing CreateChainParams method.
Diffstat (limited to 'src/chainparams.h')
-rw-r--r--src/chainparams.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/chainparams.h b/src/chainparams.h
index f2e2eb8bc0..30488510d7 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -151,6 +151,11 @@ public:
bool fastprune{false};
};
+ static std::unique_ptr<const CChainParams> RegTest(const RegTestOptions& options);
+ static std::unique_ptr<const CChainParams> SigNet(const SigNetOptions& options);
+ static std::unique_ptr<const CChainParams> Main();
+ static std::unique_ptr<const CChainParams> TestNet();
+
protected:
CChainParams() {}