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 a bool bitfield to reduce implicit conversions at call sites. - Use a consistent height/coinbase packing style across Coin serialization, undo serialization, and coinstats hashing (casting
nHeighttouint32_tbefore shifting to avoid signed-promotion UB). - Adjust UTXO overhead estimation to match the actual Coin layout and update the related tests accordingly.