refactor: rename hashBlock to m_block_hash to avoid shadowing

This commit is contained in:
Lőrinc
2026-02-20 15:48:21 +01:00
parent d2844c6a4f
commit 06172ef0d5
2 changed files with 7 additions and 7 deletions

View File

@@ -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 */

View File

@@ -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;