File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,13 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
99
99
100
100
std::vector<bool > have_txn (txn_available.size ());
101
101
LOCK (pool->cs );
102
- for (CTxMemPool::txiter it = pool->mapTx .begin (); it != pool->mapTx .end (); it++) {
103
- std::unordered_map<uint64_t , uint16_t >::iterator idit = shorttxids.find (cmpctblock.GetShortID (it->GetTx ().GetHash ()));
102
+ const std::vector<std::pair<uint256, CTxMemPool::txiter> >& vTxHashes = pool->vTxHashes ;
103
+ for (size_t i = 0 ; i < vTxHashes.size (); i++) {
104
+ uint64_t shortid = cmpctblock.GetShortID (vTxHashes[i].first );
105
+ std::unordered_map<uint64_t , uint16_t >::iterator idit = shorttxids.find (shortid);
104
106
if (idit != shorttxids.end ()) {
105
107
if (!have_txn[idit->second ]) {
106
- txn_available[idit->second ] = it ->GetSharedTx ();
108
+ txn_available[idit->second ] = vTxHashes[i]. second ->GetSharedTx ();
107
109
have_txn[idit->second ] = true ;
108
110
mempool_count++;
109
111
} else {
You can’t perform that action at this time.
0 commit comments