test: don't check for FRESH but not DIRTY entries in SanityCheck

This commit is contained in:
Andrew Toth 2024-08-18 17:17:11 -04:00
parent 87de3e6c32
commit 2c3e62d452
No known key found for this signature in database
GPG Key ID: 60007AFC8938B018

View File

@ -315,14 +315,14 @@ void CCoinsViewCache::SanityCheck() const
if (entry.IsDirty()) attr |= 1;
if (entry.IsFresh()) attr |= 2;
if (entry.coin.IsSpent()) attr |= 4;
// Only 5 combinations are possible.
assert(attr != 2 && attr != 4 && attr != 7);
// Only 4 combinations are possible.
assert(attr != 2 && attr != 4 && attr != 6 && attr != 7);
// Recompute cachedCoinsUsage.
recomputed_usage += entry.coin.DynamicMemoryUsage();
// Count the number of entries we expect in the linked list.
if (entry.IsDirty() || entry.IsFresh()) ++count_flagged;
if (entry.IsDirty()) ++count_flagged;
}
// Iterate over the linked list of flagged entries.
size_t count_linked = 0;
@ -331,7 +331,7 @@ void CCoinsViewCache::SanityCheck() const
assert(it->second.Next()->second.Prev() == it);
assert(it->second.Prev()->second.Next() == it);
// Verify they are actually flagged.
assert(it->second.IsDirty() || it->second.IsFresh());
assert(it->second.IsDirty());
// Count the number of entries actually in the list.
++count_linked;
}