The getblockstats RPC currently overestimates UTXO overhead by treating the fCoinBase bitfield as an additional bool in PER_UTXO_OVERHEAD.
However, fCoinBase and nHeight are stored as bitfields and effectively packed into a single 32-bit value; counting an extra bool in the overhead calculation is unnecessary.
This PR introduces the following changes across three commits:
- Store
fCoinBaseas aboolbitfield to reduce implicit conversions at call sites. - Use a consistent height/coinbase packing style across
Coinserialization, undo serialization, and coinstats hashing (castingnHeighttouint32_tbefore shifting to avoid signed-promotion UB). - Adjust UTXO overhead estimation to match the actual
Coinlayout and update the related tests accordingly.