Skip to content

Commit c64b2c6

Browse files
committed
scripted-diff: rename versionbitscache
-BEGIN VERIFY SCRIPT- sed -i -e 's/versionbitscache/g_versionbitscache/g' $(git grep -l versionbitscache) -END VERIFY SCRIPT-
1 parent de55304 commit c64b2c6

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/deploymentstatus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <consensus/params.h>
88
#include <versionbits.h>
99

10-
VersionBitsCache versionbitscache;
10+
VersionBitsCache g_versionbitscache;
1111

1212
/* Basic sanity checking for BuriedDeployment/DeploymentPos enums and
1313
* ValidDeployment check */

src/deploymentstatus.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <limits>
1212

1313
/** Global cache for versionbits deployment status */
14-
extern VersionBitsCache versionbitscache;
14+
extern VersionBitsCache g_versionbitscache;
1515

1616
/** Determine if a deployment is active for the next block */
1717
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::BuriedDeployment dep)
@@ -23,7 +23,7 @@ inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus
2323
inline bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos dep)
2424
{
2525
assert(Consensus::ValidDeployment(dep));
26-
return ThresholdState::ACTIVE == VersionBitsState(pindexPrev, params, dep, versionbitscache);
26+
return ThresholdState::ACTIVE == VersionBitsState(pindexPrev, params, dep, g_versionbitscache);
2727
}
2828

2929
/** Determine if a deployment is active for this block */

src/rpc/blockchain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ static void BIP9SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniVal
13691369
if (consensusParams.vDeployments[id].nStartTime == Consensus::BIP9Deployment::NEVER_ACTIVE) return;
13701370

13711371
UniValue bip9(UniValue::VOBJ);
1372-
const ThresholdState thresholdState = VersionBitsState(active_chain_tip, consensusParams, id, versionbitscache);
1372+
const ThresholdState thresholdState = VersionBitsState(active_chain_tip, consensusParams, id, g_versionbitscache);
13731373
switch (thresholdState) {
13741374
case ThresholdState::DEFINED: bip9.pushKV("status", "defined"); break;
13751375
case ThresholdState::STARTED: bip9.pushKV("status", "started"); break;
@@ -1383,7 +1383,7 @@ static void BIP9SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniVal
13831383
}
13841384
bip9.pushKV("start_time", consensusParams.vDeployments[id].nStartTime);
13851385
bip9.pushKV("timeout", consensusParams.vDeployments[id].nTimeout);
1386-
int64_t since_height = VersionBitsStateSinceHeight(active_chain_tip, consensusParams, id, versionbitscache);
1386+
int64_t since_height = VersionBitsStateSinceHeight(active_chain_tip, consensusParams, id, g_versionbitscache);
13871387
bip9.pushKV("since", since_height);
13881388
if (ThresholdState::STARTED == thresholdState)
13891389
{

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ static RPCHelpMan getblocktemplate()
841841
UniValue vbavailable(UniValue::VOBJ);
842842
for (int j = 0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {
843843
Consensus::DeploymentPos pos = Consensus::DeploymentPos(j);
844-
ThresholdState state = VersionBitsState(pindexPrev, consensusParams, pos, versionbitscache);
844+
ThresholdState state = VersionBitsState(pindexPrev, consensusParams, pos, g_versionbitscache);
845845
switch (state) {
846846
case ThresholdState::DEFINED:
847847
case ThresholdState::FAILED:

src/test/versionbits_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ BOOST_AUTO_TEST_CASE(versionbits_test)
259259
/** Check that ComputeBlockVersion will set the appropriate bit correctly */
260260
static void check_computeblockversion(const Consensus::Params& params, Consensus::DeploymentPos dep)
261261
{
262-
// This implicitly uses versionbitscache, so clear it every time
263-
versionbitscache.Clear();
262+
// This implicitly uses g_versionbitscache, so clear it every time
263+
g_versionbitscache.Clear();
264264

265265
int64_t bit = params.vDeployments[dep].bit;
266266
int64_t nStartTime = params.vDeployments[dep].nStartTime;

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Para
16111611
int32_t nVersion = VERSIONBITS_TOP_BITS;
16121612

16131613
for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; i++) {
1614-
ThresholdState state = VersionBitsState(pindexPrev, params, static_cast<Consensus::DeploymentPos>(i), versionbitscache);
1614+
ThresholdState state = VersionBitsState(pindexPrev, params, static_cast<Consensus::DeploymentPos>(i), g_versionbitscache);
16151615
if (state == ThresholdState::LOCKED_IN || state == ThresholdState::STARTED) {
16161616
nVersion |= VersionBitsMask(params, static_cast<Consensus::DeploymentPos>(i));
16171617
}
@@ -4110,7 +4110,7 @@ void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
41104110
nLastBlockFile = 0;
41114111
setDirtyBlockIndex.clear();
41124112
setDirtyFileInfo.clear();
4113-
versionbitscache.Clear();
4113+
g_versionbitscache.Clear();
41144114
for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {
41154115
warningcache[b].clear();
41164116
}

0 commit comments

Comments
 (0)