refactor: rename will_reuse_cache to reallocate_cache

More accurately reflects the purpose of the parameter, since
we will keep reusing the cache but don't want to reallocate it.
This commit is contained in:
Andrew Toth
2026-01-15 16:05:16 -05:00
parent 44b4ee194d
commit 3e0fd0e4dd
5 changed files with 9 additions and 9 deletions

View File

@@ -254,12 +254,12 @@ void CCoinsViewCache::BatchWrite(CoinsViewCacheCursor& cursor, const uint256& ha
SetBestBlock(hashBlockIn);
}
void CCoinsViewCache::Flush(bool will_reuse_cache)
void CCoinsViewCache::Flush(bool reallocate_cache)
{
auto cursor{CoinsViewCacheCursor(m_sentinel, cacheCoins, /*will_erase=*/true)};
base->BatchWrite(cursor, hashBlock);
cacheCoins.clear();
if (will_reuse_cache) {
if (reallocate_cache) {
ReallocateCache();
}
cachedCoinsUsage = 0;