|
14 | 14 | extern VersionBitsCache g_versionbitscache;
|
15 | 15 |
|
16 | 16 | /** 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) |
18 | 18 | {
|
19 | 19 | assert(Consensus::ValidDeployment(dep));
|
20 | 20 | return (pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1) >= params.DeploymentHeight(dep);
|
21 | 21 | }
|
22 | 22 |
|
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) |
24 | 24 | {
|
25 | 25 | assert(Consensus::ValidDeployment(dep));
|
26 |
| - return ThresholdState::ACTIVE == g_versionbitscache.State(pindexPrev, params, dep); |
| 26 | + return ThresholdState::ACTIVE == versionbitscache.State(pindexPrev, params, dep); |
27 | 27 | }
|
28 | 28 |
|
29 | 29 | /** 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) |
31 | 31 | {
|
32 | 32 | assert(Consensus::ValidDeployment(dep));
|
33 | 33 | return index.nHeight >= params.DeploymentHeight(dep);
|
34 | 34 | }
|
35 | 35 |
|
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) |
37 | 37 | {
|
38 | 38 | assert(Consensus::ValidDeployment(dep));
|
39 |
| - return DeploymentActiveAfter(index.pprev, params, dep); |
| 39 | + return DeploymentActiveAfter(index.pprev, params, dep, versionbitscache); |
40 | 40 | }
|
41 | 41 |
|
42 | 42 | /** Determine if a deployment is enabled (can ever be active) */
|
|
0 commit comments