coins: make Coin::fCoinBase a bool

The coinbase flag is semantically boolean but was stored as an unsigned bitfield. Store it as a `bool : 1` bitfield to better reflect intent and avoid relying on implicit integral conversions at call sites.

Update users to prefer `Coin::IsCoinBase()` and to pass explicit `true`/`false` values where appropriate.
This commit is contained in:
Lőrinc
2024-12-09 13:25:25 +01:00
parent 5f6bfa3649
commit 1f309d1aa2
6 changed files with 10 additions and 10 deletions

View File

@@ -2214,7 +2214,7 @@ DisconnectResult Chainstate::DisconnectBlock(const CBlock& block, const CBlockIn
COutPoint out(hash, o);
Coin coin;
bool is_spent = view.SpendCoin(out, &coin);
if (!is_spent || tx.vout[o] != coin.out || pindex->nHeight != coin.nHeight || is_coinbase != coin.fCoinBase) {
if (!is_spent || tx.vout[o] != coin.out || pindex->nHeight != coin.nHeight || is_coinbase != coin.IsCoinBase()) {
if (!is_bip30_exception) {
fClean = false; // transaction output mismatch
}