mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 14:48:46 +02:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user