Skip to content

Commit 3733ed2

Browse files
committed
log: Size of missing tx'es when reconstructing compact block
1 parent 36bcee0 commit 3733ed2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/blockencodings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,14 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
187187
block = header;
188188
block.vtx.resize(txn_available.size());
189189

190+
unsigned int tx_missing_size = 0;
190191
size_t tx_missing_offset = 0;
191192
for (size_t i = 0; i < txn_available.size(); i++) {
192193
if (!txn_available[i]) {
193194
if (vtx_missing.size() <= tx_missing_offset)
194195
return READ_STATUS_INVALID;
195196
block.vtx[i] = vtx_missing[tx_missing_offset++];
197+
tx_missing_size += block.vtx[i]->GetTotalSize();
196198
} else
197199
block.vtx[i] = std::move(txn_available[i]);
198200
}
@@ -216,7 +218,7 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
216218
return READ_STATUS_CHECKBLOCK_FAILED;
217219
}
218220

219-
LogDebug(BCLog::CMPCTBLOCK, "Successfully reconstructed block %s with %lu txn prefilled, %lu txn from mempool (incl at least %lu from extra pool) and %lu txn requested\n", hash.ToString(), prefilled_count, mempool_count, extra_count, vtx_missing.size());
221+
LogDebug(BCLog::CMPCTBLOCK, "Successfully reconstructed block %s with %u txn prefilled, %u txn from mempool (incl at least %u from extra pool) and %u txn (%u bytes) requested\n", hash.ToString(), prefilled_count, mempool_count, extra_count, vtx_missing.size(), tx_missing_size);
220222
if (vtx_missing.size() < 5) {
221223
for (const auto& tx : vtx_missing) {
222224
LogDebug(BCLog::CMPCTBLOCK, "Reconstructed block %s required tx %s\n", hash.ToString(), tx->GetHash().ToString());

0 commit comments

Comments
 (0)