mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
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:
parent
df34a94e57
commit
9715d3bf1e
2 changed files with 2 additions and 1 deletions
|
@ -131,6 +131,7 @@ struct CCoinsCacheEntry
|
||||||
explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}
|
explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}
|
||||||
CCoinsCacheEntry(Coin&& coin_, unsigned char flag) : coin(std::move(coin_)), flags(flag) {}
|
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 IsDirty() const noexcept { return flags & DIRTY; }
|
||||||
inline bool IsFresh() const noexcept { return flags & FRESH; }
|
inline bool IsFresh() const noexcept { return flags & FRESH; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -603,7 +603,7 @@ void GetCoinsMapEntry(const CCoinsMap& map, CAmount& value, char& flags, const C
|
||||||
} else {
|
} else {
|
||||||
value = it->second.coin.out.nValue;
|
value = it->second.coin.out.nValue;
|
||||||
}
|
}
|
||||||
flags = it->second.flags;
|
flags = it->second.GetFlags();
|
||||||
assert(flags != NO_ENTRY);
|
assert(flags != NO_ENTRY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue