aboutsummaryrefslogtreecommitdiff
path: root/src/deploymentinfo.h
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-03-11 12:47:24 +1000
committerAnthony Towns <aj@erisian.com.au>2021-06-30 08:19:12 +1000
commit92f48f360da5f425428b761219301f509826bec4 (patch)
tree06edcd128c8025ada2211aaaa4aa5212e9867f48 /src/deploymentinfo.h
parentea68b3a5729f5d240e968388c4f88acffeb27228 (diff)
downloadbitcoin-92f48f360da5f425428b761219301f509826bec4.tar.xz
deploymentinfo: Add DeploymentName()
Diffstat (limited to 'src/deploymentinfo.h')
-rw-r--r--src/deploymentinfo.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/deploymentinfo.h b/src/deploymentinfo.h
index 4c68856eac..63d58a7da2 100644
--- a/src/deploymentinfo.h
+++ b/src/deploymentinfo.h
@@ -5,6 +5,10 @@
#ifndef BITCOIN_DEPLOYMENTINFO_H
#define BITCOIN_DEPLOYMENTINFO_H
+#include <consensus/params.h>
+
+#include <string>
+
struct VBDeploymentInfo {
/** Deployment name */
const char *name;
@@ -12,6 +16,14 @@ struct VBDeploymentInfo {
bool gbt_force;
};
-extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];
+extern const VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS];
+
+std::string DeploymentName(Consensus::BuriedDeployment dep);
+
+inline std::string DeploymentName(Consensus::DeploymentPos pos)
+{
+ assert(Consensus::ValidDeployment(pos));
+ return VersionBitsDeploymentInfo[pos].name;
+}
#endif // BITCOIN_DEPLOYMENTINFO_H