diff options
author | glozow <gloriajzhao@gmail.com> | 2023-08-25 17:01:51 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-11-10 16:44:42 +0100 |
commit | a03aef9cec35b0d03aa63d7e8093f0420cd4b40b (patch) | |
tree | c4e8035914801e9d5ed9637de22848c0961bfa55 /src/blockencodings.cpp | |
parent | 938643c3b2b8e7b9aec1df34a2f8a95d616d8dd5 (diff) | |
download | bitcoin-a03aef9cec35b0d03aa63d7e8093f0420cd4b40b.tar.xz |
[refactor] rewrite vTxHashes as a vector of CTransactionRef
vTxHashes exposes a complex mapTx iterator type that its external users
don't need. Directly populate it with CTransactionRef instead.
Diffstat (limited to 'src/blockencodings.cpp')
-rw-r--r-- | src/blockencodings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index 211b4740be..9b8f49cbc8 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -107,12 +107,12 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c std::vector<bool> have_txn(txn_available.size()); { LOCK(pool->cs); - for (size_t i = 0; i < pool->vTxHashes.size(); i++) { - uint64_t shortid = cmpctblock.GetShortID(pool->vTxHashes[i].first); + for (const auto& tx : pool->vTxHashes) { + uint64_t shortid = cmpctblock.GetShortID(tx->GetWitnessHash()); std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid); if (idit != shorttxids.end()) { if (!have_txn[idit->second]) { - txn_available[idit->second] = pool->vTxHashes[i].second->GetSharedTx(); + txn_available[idit->second] = tx; have_txn[idit->second] = true; mempool_count++; } else { |