File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,21 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
1616 /* .gbt_force =*/ true ,
1717 },
1818};
19+
20+ std::string DeploymentName (Consensus::BuriedDeployment dep)
21+ {
22+ assert (ValidDeployment (dep));
23+ switch (dep) {
24+ case Consensus::DEPLOYMENT_HEIGHTINCB:
25+ return " bip34" ;
26+ case Consensus::DEPLOYMENT_CLTV:
27+ return " bip65" ;
28+ case Consensus::DEPLOYMENT_DERSIG:
29+ return " bip66" ;
30+ case Consensus::DEPLOYMENT_CSV:
31+ return " csv" ;
32+ case Consensus::DEPLOYMENT_SEGWIT:
33+ return " segwit" ;
34+ } // no default case, so the compiler can warn about missing cases
35+ return " " ;
36+ }
Original file line number Diff line number Diff line change 55#ifndef BITCOIN_DEPLOYMENTINFO_H
66#define BITCOIN_DEPLOYMENTINFO_H
77
8+ #include < consensus/params.h>
9+
10+ #include < string>
11+
812struct VBDeploymentInfo {
913 /* * Deployment name */
1014 const char *name;
1115 /* * Whether GBT clients can safely ignore this rule in simplified usage */
1216 bool gbt_force;
1317};
1418
15- extern const struct VBDeploymentInfo VersionBitsDeploymentInfo [];
19+ extern const VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS];
20+
21+ std::string DeploymentName (Consensus::BuriedDeployment dep);
22+
23+ inline std::string DeploymentName (Consensus::DeploymentPos pos)
24+ {
25+ assert (Consensus::ValidDeployment (pos));
26+ return VersionBitsDeploymentInfo[pos].name ;
27+ }
1628
1729#endif // BITCOIN_DEPLOYMENTINFO_H
You can’t perform that action at this time.
0 commit comments