Skip to content

Commit 9715d3b

Browse files
committed
refactor: encapsulate flags get access for all other checks
No behavior change. This prepares moving the cache entry flags field to private access.
1 parent df34a94 commit 9715d3b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/coins.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ struct CCoinsCacheEntry
131131
explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}
132132
CCoinsCacheEntry(Coin&& coin_, unsigned char flag) : coin(std::move(coin_)), flags(flag) {}
133133

134+
inline unsigned char GetFlags() const noexcept { return flags; }
134135
inline bool IsDirty() const noexcept { return flags & DIRTY; }
135136
inline bool IsFresh() const noexcept { return flags & FRESH; }
136137
};

src/test/coins_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ void GetCoinsMapEntry(const CCoinsMap& map, CAmount& value, char& flags, const C
603603
} else {
604604
value = it->second.coin.out.nValue;
605605
}
606-
flags = it->second.flags;
606+
flags = it->second.GetFlags();
607607
assert(flags != NO_ENTRY);
608608
}
609609
}

0 commit comments

Comments
 (0)