@@ -2573,8 +2573,8 @@ bool CChainState::FlushStateToDisk(
2573
2573
std::set<int > setFilesToPrune;
2574
2574
bool full_flush_completed = false ;
2575
2575
2576
- const size_t coins_count = :: ChainstateActive (). CoinsTip ().GetCacheSize ();
2577
- const size_t coins_mem_usage = :: ChainstateActive (). CoinsTip ().DynamicMemoryUsage ();
2576
+ const size_t coins_count = CoinsTip ().GetCacheSize ();
2577
+ const size_t coins_mem_usage = CoinsTip ().DynamicMemoryUsage ();
2578
2578
2579
2579
try {
2580
2580
{
@@ -3448,8 +3448,8 @@ bool CChainState::InvalidateBlock(BlockValidationState& state, CBlockIndex* pind
3448
3448
// it up here, this should be an essentially unobservable error.
3449
3449
// Loop back over all block index entries and add any missing entries
3450
3450
// to setBlockIndexCandidates.
3451
- BlockMap::iterator it = g_chainman. BlockIndex () .begin ();
3452
- while (it != g_chainman. BlockIndex () .end ()) {
3451
+ BlockMap::iterator it = m_blockman. m_block_index .begin ();
3452
+ while (it != m_blockman. m_block_index .end ()) {
3453
3453
if (it->second ->IsValid (BLOCK_VALID_TRANSACTIONS) && !(it->second ->nStatus & BLOCK_CONFLICT_CHAINLOCK) && it->second ->HaveTxsDownloaded () && !setBlockIndexCandidates.value_comp ()(it->second , m_chain.Tip ())) {
3454
3454
setBlockIndexCandidates.insert (it->second );
3455
3455
}
@@ -3479,7 +3479,7 @@ void CChainState::EnforceBlock(BlockValidationState& state, const CBlockIndex *p
3479
3479
3480
3480
while (pindex_walk && !m_chain.Contains (pindex_walk)) {
3481
3481
// Mark all blocks that have the same prevBlockHash but are not equal to blockHash as conflicting
3482
- auto itp = g_chainman. PrevBlockIndex () .equal_range (pindex_walk->pprev ->GetBlockHash ());
3482
+ auto itp = m_blockman. m_prev_block_index .equal_range (pindex_walk->pprev ->GetBlockHash ());
3483
3483
for (auto jt = itp.first ; jt != itp.second ; ++jt) {
3484
3484
if (jt->second == pindex_walk) {
3485
3485
continue ;
@@ -3552,8 +3552,8 @@ bool CChainState::MarkConflictingBlock(BlockValidationState& state, CBlockIndex
3552
3552
3553
3553
// The resulting new best tip may not be in setBlockIndexCandidates anymore, so
3554
3554
// add it again.
3555
- BlockMap::iterator it = g_chainman. BlockIndex () .begin ();
3556
- while (it != g_chainman. BlockIndex () .end ()) {
3555
+ BlockMap::iterator it = m_blockman. m_block_index .begin ();
3556
+ while (it != m_blockman. m_block_index .end ()) {
3557
3557
if (it->second ->IsValid (BLOCK_VALID_TRANSACTIONS) && !(it->second ->nStatus & BLOCK_CONFLICT_CHAINLOCK) && it->second ->HaveTxsDownloaded () && !setBlockIndexCandidates.value_comp ()(it->second , m_chain.Tip ())) {
3558
3558
setBlockIndexCandidates.insert (it->second );
3559
3559
}
@@ -4265,8 +4265,8 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, Block
4265
4265
return AbortNode (state, std::string (" System error: " ) + e.what ());
4266
4266
}
4267
4267
4268
- if (:: ChainstateActive (). CanFlushToDisk ()) {
4269
- ::ChainstateActive (). FlushStateToDisk(state, FlushStateMode::NONE);
4268
+ if (CanFlushToDisk ()) {
4269
+ FlushStateToDisk (state, FlushStateMode::NONE);
4270
4270
}
4271
4271
4272
4272
CheckBlockIndex ();
0 commit comments