Skip to content

Commit 5f274a1

Browse files
committed
log block size and weight correctly.
1 parent 14e8f99 commit 5f274a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/miner.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn)
168168
nLastBlockTx = nBlockTx;
169169
nLastBlockSize = nBlockSize;
170170
nLastBlockWeight = nBlockWeight;
171-
LogPrintf("CreateNewBlock(): total size %u txs: %u fees: %ld sigops %d\n", nBlockSize, nBlockTx, nFees, nBlockSigOpsCost);
172171

173172
// Create coinbase transaction.
174173
CMutableTransaction coinbaseTx;
@@ -182,6 +181,9 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn)
182181
pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus());
183182
pblocktemplate->vTxFees[0] = -nFees;
184183

184+
uint64_t nSerializeSize = GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION);
185+
LogPrintf("CreateNewBlock(): total size: %u block weight: %u txs: %u fees: %ld sigops %d\n", nSerializeSize, GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost);
186+
185187
// Fill in header
186188
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
187189
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);

0 commit comments

Comments
 (0)