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
16
16
/* .gbt_force =*/ true ,
17
17
},
18
18
};
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 5
5
#ifndef BITCOIN_DEPLOYMENTINFO_H
6
6
#define BITCOIN_DEPLOYMENTINFO_H
7
7
8
+ #include < consensus/params.h>
9
+
10
+ #include < string>
11
+
8
12
struct VBDeploymentInfo {
9
13
/* * Deployment name */
10
14
const char *name;
11
15
/* * Whether GBT clients can safely ignore this rule in simplified usage */
12
16
bool gbt_force;
13
17
};
14
18
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
+ }
16
28
17
29
#endif // BITCOIN_DEPLOYMENTINFO_H
You can’t perform that action at this time.
0 commit comments