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 committed 2024-08-01 23:36:00 -04:00
1 parent df34a94e57
commit 9715d3bf1e
2 files changed
+2 -1

No files matched your search

+1
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; }
};
+1 -1
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);
}
}