diff --git a/src/consensus/params.h b/src/consensus/params.h index dd29b9408e2..32f14c25e84 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -104,7 +105,7 @@ struct Params { */ uint32_t nRuleChangeActivationThreshold; uint32_t nMinerConfirmationWindow; - BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]; + std::array vDeployments; /** Proof of work parameters */ uint256 powLimit; bool fPowAllowMinDifficultyBlocks; diff --git a/src/deploymentinfo.cpp b/src/deploymentinfo.cpp index 185a7dcb54c..0931ec77d37 100644 --- a/src/deploymentinfo.cpp +++ b/src/deploymentinfo.cpp @@ -8,14 +8,14 @@ #include -const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = { - { - /*.name =*/ "testdummy", - /*.gbt_force =*/ true, +const std::array VersionBitsDeploymentInfo{ + VBDeploymentInfo{ + .name = "testdummy", + .gbt_force = true, }, - { - /*.name =*/ "taproot", - /*.gbt_force =*/ true, + VBDeploymentInfo{ + .name = "taproot", + .gbt_force = true, }, }; diff --git a/src/deploymentinfo.h b/src/deploymentinfo.h index 72ba297ea0b..b6ca4450f41 100644 --- a/src/deploymentinfo.h +++ b/src/deploymentinfo.h @@ -7,6 +7,7 @@ #include +#include #include #include @@ -17,7 +18,7 @@ struct VBDeploymentInfo { bool gbt_force; }; -extern const VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]; +extern const std::array VersionBitsDeploymentInfo; std::string DeploymentName(Consensus::BuriedDeployment dep); diff --git a/src/versionbits.h b/src/versionbits.h index 09313d2054a..8d2cd0f43d4 100644 --- a/src/versionbits.h +++ b/src/versionbits.h @@ -8,6 +8,7 @@ #include #include +#include #include /** What block version to use for new blocks (pre versionbits) */ @@ -81,7 +82,7 @@ class VersionBitsCache { private: Mutex m_mutex; - ThresholdConditionCache m_caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] GUARDED_BY(m_mutex); + std::array m_caches GUARDED_BY(m_mutex); public: /** Get the numerical statistics for a given deployment for the signalling period that includes pindex.