[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.
This commit is contained in:
Anthony Towns
2020-12-29 11:19:06 +10:00
parent 8ee3e0bed5
commit 0cfd6c6a8f
7 changed files with 39 additions and 34 deletions

View File

@@ -23,7 +23,7 @@ inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos dep)
{
assert(Consensus::ValidDeployment(dep));
return ThresholdState::ACTIVE == VersionBitsState(pindexPrev, params, dep, g_versionbitscache);
return ThresholdState::ACTIVE == g_versionbitscache.State(pindexPrev, params, dep);
}
/** Determine if a deployment is active for this block */