@@ -1921,7 +1921,7 @@ class WarningBitsConditionChecker : public AbstractThresholdConditionChecker
1921
1921
}
1922
1922
};
1923
1923
1924
- static ThresholdConditionCache warningcache[ VERSIONBITS_NUM_BITS] GUARDED_BY(cs_main);
1924
+ static std::array< ThresholdConditionCache, VERSIONBITS_NUM_BITS> warningcache GUARDED_BY (cs_main);
1925
1925
1926
1926
static unsigned int GetBlockScriptFlags (const CBlockIndex& block_index, const Consensus::Params& consensusparams)
1927
1927
{
@@ -2550,7 +2550,7 @@ void CChainState::UpdateTip(const CBlockIndex* pindexNew)
2550
2550
const CBlockIndex* pindex = pindexNew;
2551
2551
for (int bit = 0 ; bit < VERSIONBITS_NUM_BITS; bit++) {
2552
2552
WarningBitsConditionChecker checker (bit);
2553
- ThresholdState state = checker.GetStateFor (pindex, m_params.GetConsensus (), warningcache[ bit] );
2553
+ ThresholdState state = checker.GetStateFor (pindex, m_params.GetConsensus (), warningcache. at ( bit) );
2554
2554
if (state == ThresholdState::ACTIVE || state == ThresholdState::LOCKED_IN) {
2555
2555
const bilingual_str warning = strprintf (_ (" Unknown new rules activated (versionbit %i)" ), bit);
2556
2556
if (state == ThresholdState::ACTIVE) {
@@ -4152,8 +4152,8 @@ void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
4152
4152
chainman.Unload ();
4153
4153
if (mempool) mempool->clear ();
4154
4154
g_versionbitscache.Clear ();
4155
- for (int b = 0 ; b < VERSIONBITS_NUM_BITS; b++ ) {
4156
- warningcache[b] .clear ();
4155
+ for (auto & i : warningcache ) {
4156
+ i .clear ();
4157
4157
}
4158
4158
}
4159
4159
0 commit comments