mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-15 07:46:56 +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:
@@ -480,7 +480,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
|
||||
ScriptToUniv(prev_txout.scriptPubKey, /*out=*/o_script_pub_key, /*include_hex=*/true, /*include_address=*/true);
|
||||
|
||||
UniValue p(UniValue::VOBJ);
|
||||
p.pushKV("generated", static_cast<bool>(prev_coin.fCoinBase));
|
||||
p.pushKV("generated", prev_coin.IsCoinBase());
|
||||
p.pushKV("height", prev_coin.nHeight);
|
||||
p.pushKV("value", ValueFromAmount(prev_txout.nValue));
|
||||
p.pushKV("scriptPubKey", std::move(o_script_pub_key));
|
||||
|
||||
Reference in New Issue
Block a user