refactor: encapsulate flags access for dirty and fresh checks

No behavior change. This prepares moving the cache entry flags field
to private access.

Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
Andrew Toth
2024-06-28 16:11:16 -04:00
parent 9774a958b5
commit df34a94e57
5 changed files with 16 additions and 13 deletions

View File

@@ -175,7 +175,7 @@ public:
bool BatchWrite(CCoinsMap& data, const uint256&, bool erase) final
{
for (auto it = data.begin(); it != data.end(); it = erase ? data.erase(it) : std::next(it)) {
if (it->second.flags & CCoinsCacheEntry::DIRTY) {
if (it->second.IsDirty()) {
if (it->second.coin.IsSpent() && (it->first.n % 5) != 4) {
m_data.erase(it->first);
} else if (erase) {