refactor: rename CTransaction::GetTotalSize to signal that it's not cached

Transaction hashes are cached, it may not be intuitive that their sizes are actually recalculated every time.
This is done before the other refactors to clarify why we want to avoid calling this method;

Co-authored-by: maflcko <6399679+maflcko@users.noreply.github.com>
This commit is contained in:
Lőrinc
2025-10-31 14:51:04 +01:00
parent 898e8d3a2d
commit 1658b8f82b
10 changed files with 12 additions and 12 deletions

View File

@@ -2577,7 +2577,7 @@ void PeerManagerImpl::SendBlockTransactions(CNode& pfrom, Peer& peer, const CBlo
return;
}
resp.txn[i] = block.vtx[req.indexes[i]];
tx_requested_size += resp.txn[i]->GetTotalSize();
tx_requested_size += resp.txn[i]->ComputeTotalSize();
}
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);