aboutsummaryrefslogtreecommitdiff
path: root/src/deploymentstatus.h
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-04-15 06:23:59 +1000
committerAnthony Towns <aj@erisian.com.au>2022-05-10 12:09:33 +1000
commitd603f1d8a7cdc0a158ed80ade8a843b61b6ad08e (patch)
tree481420bd120d683224f7c6bd8768df9fd2a558de /src/deploymentstatus.h
parent78adef17536edef833a0bfca06b61ce28120e486 (diff)
deploymentstatus: make versionbitscache a parameter
Diffstat (limited to 'src/deploymentstatus.h')
-rw-r--r--src/deploymentstatus.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/deploymentstatus.h b/src/deploymentstatus.h
index ba5103de74..29679ae800 100644
--- a/src/deploymentstatus.h
+++ b/src/deploymentstatus.h
@@ -14,29 +14,29 @@
extern VersionBitsCache g_versionbitscache;
/** Determine if a deployment is active for the next block */
-inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::BuriedDeployment dep)
+inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::BuriedDeployment dep, [[maybe_unused]] VersionBitsCache& versionbitscache = g_versionbitscache)
{
assert(Consensus::ValidDeployment(dep));
return (pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1) >= params.DeploymentHeight(dep);
}
-inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos dep)
+inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos dep, VersionBitsCache& versionbitscache = g_versionbitscache)
{
assert(Consensus::ValidDeployment(dep));
- return ThresholdState::ACTIVE == g_versionbitscache.State(pindexPrev, params, dep);
+ return ThresholdState::ACTIVE == versionbitscache.State(pindexPrev, params, dep);
}
/** Determine if a deployment is active for this block */
-inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::BuriedDeployment dep)
+inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::BuriedDeployment dep, [[maybe_unused]] VersionBitsCache& versionbitscache = g_versionbitscache)
{
assert(Consensus::ValidDeployment(dep));
return index.nHeight >= params.DeploymentHeight(dep);
}
-inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::DeploymentPos dep)
+inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::DeploymentPos dep, VersionBitsCache& versionbitscache = g_versionbitscache)
{
assert(Consensus::ValidDeployment(dep));
- return DeploymentActiveAfter(index.pprev, params, dep);
+ return DeploymentActiveAfter(index.pprev, params, dep, versionbitscache);
}
/** Determine if a deployment is enabled (can ever be active) */