Skip to content

Commit d603f1d

Browse files
committed
deploymentstatus: make versionbitscache a parameter
1 parent 78adef1 commit d603f1d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/deploymentstatus.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414
extern VersionBitsCache g_versionbitscache;
1515

1616
/** Determine if a deployment is active for the next block */
17-
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::BuriedDeployment dep)
17+
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::BuriedDeployment dep, [[maybe_unused]] VersionBitsCache& versionbitscache = g_versionbitscache)
1818
{
1919
assert(Consensus::ValidDeployment(dep));
2020
return (pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1) >= params.DeploymentHeight(dep);
2121
}
2222

23-
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos dep)
23+
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos dep, VersionBitsCache& versionbitscache = g_versionbitscache)
2424
{
2525
assert(Consensus::ValidDeployment(dep));
26-
return ThresholdState::ACTIVE == g_versionbitscache.State(pindexPrev, params, dep);
26+
return ThresholdState::ACTIVE == versionbitscache.State(pindexPrev, params, dep);
2727
}
2828

2929
/** Determine if a deployment is active for this block */
30-
inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::BuriedDeployment dep)
30+
inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::BuriedDeployment dep, [[maybe_unused]] VersionBitsCache& versionbitscache = g_versionbitscache)
3131
{
3232
assert(Consensus::ValidDeployment(dep));
3333
return index.nHeight >= params.DeploymentHeight(dep);
3434
}
3535

36-
inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::DeploymentPos dep)
36+
inline bool DeploymentActiveAt(const CBlockIndex& index, const Consensus::Params& params, Consensus::DeploymentPos dep, VersionBitsCache& versionbitscache = g_versionbitscache)
3737
{
3838
assert(Consensus::ValidDeployment(dep));
39-
return DeploymentActiveAfter(index.pprev, params, dep);
39+
return DeploymentActiveAfter(index.pprev, params, dep, versionbitscache);
4040
}
4141

4242
/** Determine if a deployment is enabled (can ever be active) */

0 commit comments

Comments
 (0)