Skip to content

Commit 83df64d

Browse files
committed
log: Stats when fulfilling GETBLOCKTXN
1 parent 3733ed2 commit 83df64d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,14 +2495,17 @@ uint32_t PeerManagerImpl::GetFetchFlags(const Peer& peer) const
24952495
void PeerManagerImpl::SendBlockTransactions(CNode& pfrom, Peer& peer, const CBlock& block, const BlockTransactionsRequest& req)
24962496
{
24972497
BlockTransactions resp(req);
2498+
unsigned int tx_requested_size = 0;
24982499
for (size_t i = 0; i < req.indexes.size(); i++) {
24992500
if (req.indexes[i] >= block.vtx.size()) {
25002501
Misbehaving(peer, "getblocktxn with out-of-bounds tx indices");
25012502
return;
25022503
}
25032504
resp.txn[i] = block.vtx[req.indexes[i]];
2505+
tx_requested_size += resp.txn[i]->GetTotalSize();
25042506
}
25052507

2508+
LogDebug(BCLog::CMPCTBLOCK, "Peer %d sent us a GETBLOCKTXN for block %s, sending a BLOCKTXN with %u txns. (%u bytes)\n", pfrom.GetId(), block.GetHash().ToString(), resp.txn.size(), tx_requested_size);
25062509
MakeAndPushMessage(pfrom, NetMsgType::BLOCKTXN, resp);
25072510
}
25082511

0 commit comments

Comments
 (0)