diff --git a/src/coins.cpp b/src/coins.cpp index 25b1ead0c1d..5104b558f0d 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -196,13 +196,13 @@ bool CCoinsViewCache::HaveCoinInCache(const COutPoint &outpoint) const { } uint256 CCoinsViewCache::GetBestBlock() const { - if (hashBlock.IsNull()) - hashBlock = base->GetBestBlock(); - return hashBlock; + if (m_block_hash.IsNull()) + m_block_hash = base->GetBestBlock(); + return m_block_hash; } void CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { - hashBlock = hashBlockIn; + m_block_hash = hashBlockIn; } void CCoinsViewCache::BatchWrite(CoinsViewCacheCursor& cursor, const uint256& hashBlockIn) @@ -279,7 +279,7 @@ void CCoinsViewCache::BatchWrite(CoinsViewCacheCursor& cursor, const uint256& ha void CCoinsViewCache::Flush(bool reallocate_cache) { auto cursor{CoinsViewCacheCursor(m_dirty_count, m_sentinel, cacheCoins, /*will_erase=*/true)}; - base->BatchWrite(cursor, hashBlock); + base->BatchWrite(cursor, m_block_hash); Assume(m_dirty_count == 0); cacheCoins.clear(); if (reallocate_cache) { @@ -291,7 +291,7 @@ void CCoinsViewCache::Flush(bool reallocate_cache) void CCoinsViewCache::Sync() { auto cursor{CoinsViewCacheCursor(m_dirty_count, m_sentinel, cacheCoins, /*will_erase=*/false)}; - base->BatchWrite(cursor, hashBlock); + base->BatchWrite(cursor, m_block_hash); Assume(m_dirty_count == 0); if (m_sentinel.second.Next() != &m_sentinel) { /* BatchWrite must clear flags of all entries */ diff --git a/src/coins.h b/src/coins.h index 08c1886f930..c0bf3c5a174 100644 --- a/src/coins.h +++ b/src/coins.h @@ -374,7 +374,7 @@ protected: * Make mutable so that we can "fill the cache" even from Get-methods * declared as "const". */ - mutable uint256 hashBlock; + mutable uint256 m_block_hash; mutable CCoinsMapMemoryResource m_cache_coins_memory_resource{}; /* The starting sentinel of the flagged entry circular doubly linked list. */ mutable CoinsCachePair m_sentinel;