Skip to content

Commit b55b416

Browse files
committed
Add extra_count lower bound to compact reconstruction debug print
1 parent 863edb4 commit b55b416

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/blockencodings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
141141
txn_available[idit->second] = extra_txn[i].second;
142142
have_txn[idit->second] = true;
143143
mempool_count++;
144+
extra_count++;
144145
} else {
145146
// If we find two mempool txn that match the short id, just request it.
146147
// This should be rare enough that the extra bandwidth doesn't matter,
@@ -151,6 +152,7 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
151152
txn_available[idit->second]->GetWitnessHash() != extra_txn[i].second->GetWitnessHash()) {
152153
txn_available[idit->second].reset();
153154
mempool_count--;
155+
extra_count--;
154156
}
155157
}
156158
}
@@ -206,7 +208,7 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
206208
return READ_STATUS_CHECKBLOCK_FAILED;
207209
}
208210

209-
LogPrint("cmpctblock", "Successfully reconstructed block %s with %lu txn prefilled, %lu txn from mempool and %lu txn requested\n", hash.ToString(), prefilled_count, mempool_count, vtx_missing.size());
211+
LogPrint("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());
210212
if (vtx_missing.size() < 5) {
211213
for (const auto& tx : vtx_missing)
212214
LogPrint("cmpctblock", "Reconstructed block %s required tx %s\n", hash.ToString(), tx->GetHash().ToString());

src/blockencodings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class CBlockHeaderAndShortTxIDs {
194194
class PartiallyDownloadedBlock {
195195
protected:
196196
std::vector<CTransactionRef> txn_available;
197-
size_t prefilled_count = 0, mempool_count = 0;
197+
size_t prefilled_count = 0, mempool_count = 0, extra_count = 0;
198198
CTxMemPool* pool;
199199
public:
200200
CBlockHeader header;

0 commit comments

Comments
 (0)