aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorAngusP <angus@toaster.cc>2024-03-25 20:13:35 +0100
committerAngusP <angus@toaster.cc>2024-04-06 19:17:20 +0100
commita8203e94123b6ea6e4f4a6320e3ad20457f44a28 (patch)
tree841406ff1360618288b9b1da135acfee44787503 /src/net_processing.cpp
parentc3c18433ae1d5b024d4cb92c762f5ca0ec7849c8 (diff)
downloadbitcoin-a8203e94123b6ea6e4f4a6320e3ad20457f44a28.tar.xz
refactor: Simplify `extra_txn` to be a vec of CTransactionRef instead of a vec of pair<Wtxid, CTransactionRef>
All `CTransactionRef` have `.GetWitnessHash()` that returns a cached `const Wtxid` (since fac1223a568fa1ad6dd602350598eed278d115e8), so we don't need to pass transaction refs around with their IDs as they're easy to get from a ref.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 2b71618921..39ffff97d2 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1006,7 +1006,7 @@ private:
/** Orphan/conflicted/etc transactions that are kept for compact block reconstruction.
* The last -blockreconstructionextratxn/DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN of
* these are kept in a ring buffer */
- std::vector<std::pair<Wtxid, CTransactionRef>> vExtraTxnForCompact GUARDED_BY(g_msgproc_mutex);
+ std::vector<CTransactionRef> vExtraTxnForCompact GUARDED_BY(g_msgproc_mutex);
/** Offset into vExtraTxnForCompact to insert the next tx */
size_t vExtraTxnForCompactIt GUARDED_BY(g_msgproc_mutex) = 0;
@@ -1802,7 +1802,7 @@ void PeerManagerImpl::AddToCompactExtraTransactions(const CTransactionRef& tx)
return;
if (!vExtraTxnForCompact.size())
vExtraTxnForCompact.resize(m_opts.max_extra_txs);
- vExtraTxnForCompact[vExtraTxnForCompactIt] = std::make_pair(tx->GetWitnessHash(), tx);
+ vExtraTxnForCompact[vExtraTxnForCompactIt] = tx;
vExtraTxnForCompactIt = (vExtraTxnForCompactIt + 1) % m_opts.max_extra_txs;
}