mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 22:24:05 +01:00
[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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user