mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 18:44:59 +01:00
versionbits: Use std::array instead of C-style arrays
This commit is contained in:
parent
fa0c473d4c
commit
9bc41f1b48
4 changed files with 13 additions and 10 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <uint256.h>
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
|
@ -104,7 +105,7 @@ struct Params {
|
|||
*/
|
||||
uint32_t nRuleChangeActivationThreshold;
|
||||
uint32_t nMinerConfirmationWindow;
|
||||
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS];
|
||||
std::array<BIP9Deployment,MAX_VERSION_BITS_DEPLOYMENTS> vDeployments;
|
||||
/** Proof of work parameters */
|
||||
uint256 powLimit;
|
||||
bool fPowAllowMinDifficultyBlocks;
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
#include <string_view>
|
||||
|
||||
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
|
||||
{
|
||||
/*.name =*/ "testdummy",
|
||||
/*.gbt_force =*/ true,
|
||||
const std::array<VBDeploymentInfo,Consensus::MAX_VERSION_BITS_DEPLOYMENTS> VersionBitsDeploymentInfo{
|
||||
VBDeploymentInfo{
|
||||
.name = "testdummy",
|
||||
.gbt_force = true,
|
||||
},
|
||||
{
|
||||
/*.name =*/ "taproot",
|
||||
/*.gbt_force =*/ true,
|
||||
VBDeploymentInfo{
|
||||
.name = "taproot",
|
||||
.gbt_force = true,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <consensus/params.h>
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
|
@ -17,7 +18,7 @@ struct VBDeploymentInfo {
|
|||
bool gbt_force;
|
||||
};
|
||||
|
||||
extern const VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS];
|
||||
extern const std::array<VBDeploymentInfo,Consensus::MAX_VERSION_BITS_DEPLOYMENTS> VersionBitsDeploymentInfo;
|
||||
|
||||
std::string DeploymentName(Consensus::BuriedDeployment dep);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <chain.h>
|
||||
#include <sync.h>
|
||||
|
||||
#include <array>
|
||||
#include <map>
|
||||
|
||||
/** 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<ThresholdConditionCache,Consensus::MAX_VERSION_BITS_DEPLOYMENTS> m_caches GUARDED_BY(m_mutex);
|
||||
|
||||
public:
|
||||
/** Get the numerical statistics for a given deployment for the signalling period that includes pindex.
|
||||
|
|
Loading…
Add table
Reference in a new issue