mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-12 21:21:24 +02:00
log: Size of missing tx'es when reconstructing compact block
This commit is contained in:
@@ -187,12 +187,14 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
|
||||
block = header;
|
||||
block.vtx.resize(txn_available.size());
|
||||
|
||||
unsigned int tx_missing_size = 0;
|
||||
size_t tx_missing_offset = 0;
|
||||
for (size_t i = 0; i < txn_available.size(); i++) {
|
||||
if (!txn_available[i]) {
|
||||
if (vtx_missing.size() <= tx_missing_offset)
|
||||
return READ_STATUS_INVALID;
|
||||
block.vtx[i] = vtx_missing[tx_missing_offset++];
|
||||
tx_missing_size += block.vtx[i]->GetTotalSize();
|
||||
} else
|
||||
block.vtx[i] = std::move(txn_available[i]);
|
||||
}
|
||||
@@ -216,7 +218,7 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
|
||||
return READ_STATUS_CHECKBLOCK_FAILED;
|
||||
}
|
||||
|
||||
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());
|
||||
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);
|
||||
if (vtx_missing.size() < 5) {
|
||||
for (const auto& tx : vtx_missing) {
|
||||
LogDebug(BCLog::CMPCTBLOCK, "Reconstructed block %s required tx %s\n", hash.ToString(), tx->GetHash().ToString());
|
||||
|
Reference in New Issue
Block a user