refactor: encapsulate flags get access for all other checks

No behavior change. This prepares moving the cache entry
flags field to private access.
This commit is contained in:
Andrew Toth 2024-06-28 16:19:17 -04:00
parent df34a94e57
commit 9715d3bf1e
No known key found for this signature in database
GPG key ID: 60007AFC8938B018
2 changed files with 2 additions and 1 deletions

View file

@ -131,6 +131,7 @@ struct CCoinsCacheEntry
explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}
CCoinsCacheEntry(Coin&& coin_, unsigned char flag) : coin(std::move(coin_)), flags(flag) {}
inline unsigned char GetFlags() const noexcept { return flags; }
inline bool IsDirty() const noexcept { return flags & DIRTY; }
inline bool IsFresh() const noexcept { return flags & FRESH; }
};

View file

@ -603,7 +603,7 @@ void GetCoinsMapEntry(const CCoinsMap& map, CAmount& value, char& flags, const C
} else {
value = it->second.coin.out.nValue;
}
flags = it->second.flags;
flags = it->second.GetFlags();
assert(flags != NO_ENTRY);
}
}