bitcoind writes the following log when it’s created a new block:
CreateNewBlock(): total size _ txs: _ fees: _ sigops _
If this is post-segwit and the miner is counting weight and not block size, then the size field will be incorrect (it will always be set to 1000).
This PR fixes the log in the following way:
- if the miner is not accounting for size, then only log the weight of the block.
- if the miner is accounting for size, then log the size and weight of the block.
I’ve run all tests and manually verified that the log output is correct when using the blockmaxsize
and blockmaxweight
command line parameters.