diff options
author | Carl Dong <contact@carldong.me> | 2022-03-09 16:11:39 -0500 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-03-15 16:42:42 +0100 |
commit | 84b85786f0f5cb23cc257a4464ae345e1d372313 (patch) | |
tree | ef292571361801e2e0953d0c1a82e2e54b4717d2 /src/deploymentinfo.cpp | |
parent | 76cd4e7c96242398172989609f1b9a8843c404b4 (diff) |
Decouple RegTestChainParams from ArgsManager
RegTest chain params can now be initialized by configuring a
RegTestOptions struct, or with ArgsManager. This offers an interface for
creating RegTestChainParams without a gArgs object.
Diffstat (limited to 'src/deploymentinfo.cpp')
-rw-r--r-- | src/deploymentinfo.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/deploymentinfo.cpp b/src/deploymentinfo.cpp index 246932e56d..185a7dcb54 100644 --- a/src/deploymentinfo.cpp +++ b/src/deploymentinfo.cpp @@ -6,6 +6,8 @@ #include <consensus/params.h> +#include <string_view> + const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = { { /*.name =*/ "testdummy", @@ -34,3 +36,19 @@ std::string DeploymentName(Consensus::BuriedDeployment dep) } // no default case, so the compiler can warn about missing cases return ""; } + +std::optional<Consensus::BuriedDeployment> GetBuriedDeployment(const std::string_view name) +{ + if (name == "segwit") { + return Consensus::BuriedDeployment::DEPLOYMENT_SEGWIT; + } else if (name == "bip34") { + return Consensus::BuriedDeployment::DEPLOYMENT_HEIGHTINCB; + } else if (name == "dersig") { + return Consensus::BuriedDeployment::DEPLOYMENT_DERSIG; + } else if (name == "cltv") { + return Consensus::BuriedDeployment::DEPLOYMENT_CLTV; + } else if (name == "csv") { + return Consensus::BuriedDeployment::DEPLOYMENT_CSV; + } + return std::nullopt; +} |