mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-15 10:07:41 +02:00
refactor: rename hashBlock to m_block_hash to avoid shadowing
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user