diff options
author | Anthony Towns <aj@erisian.com.au> | 2020-12-29 11:19:06 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2021-06-30 08:19:12 +1000 |
commit | 0cfd6c6a8f929d5567ac41f95c21548f115efee5 (patch) | |
tree | fd396692805022b432022c45da6bb2a18b2fa54b /src/validation.cpp | |
parent | 8ee3e0bed5bf2cd3c7a68ca6ba6c65f7b9a72cca (diff) | |
download | bitcoin-0cfd6c6a8f929d5567ac41f95c21548f115efee5.tar.xz |
[refactor] versionbits: make VersionBitsCache a full class
Moves the VersionBits* functions to be methods of the cache class,
and makes the cache and its lock private to the class.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index d2baa92dde..024f643be5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1611,9 +1611,9 @@ int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Para int32_t nVersion = VERSIONBITS_TOP_BITS; for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; i++) { - ThresholdState state = VersionBitsState(pindexPrev, params, static_cast<Consensus::DeploymentPos>(i), g_versionbitscache); + ThresholdState state = g_versionbitscache.State(pindexPrev, params, static_cast<Consensus::DeploymentPos>(i)); if (state == ThresholdState::LOCKED_IN || state == ThresholdState::STARTED) { - nVersion |= VersionBitsMask(params, static_cast<Consensus::DeploymentPos>(i)); + nVersion |= g_versionbitscache.Mask(params, static_cast<Consensus::DeploymentPos>(i)); } } |