@@ -480,8 +480,8 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
480
480
minerPolicyEstimator->processTransaction (entry, validFeeEstimate);
481
481
}
482
482
483
- vTxHashes .emplace_back (newit->GetSharedTx ());
484
- newit->vTxHashesIdx = vTxHashes .size () - 1 ;
483
+ txns_randomized .emplace_back (newit->GetSharedTx ());
484
+ newit->idx_randomized = txns_randomized .size () - 1 ;
485
485
486
486
TRACE3 (mempool, added,
487
487
entry.GetTx ().GetHash ().data (),
@@ -517,16 +517,16 @@ void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
517
517
518
518
RemoveUnbroadcastTx (hash, true /* add logging because unchecked */ );
519
519
520
- if (vTxHashes .size () > 1 ) {
521
- // Update vTxHashesIdx of the to-be-moved entry.
522
- Assert (GetEntry (vTxHashes .back ()->GetHash ()))->vTxHashesIdx = it->vTxHashesIdx ;
523
- // Remove entry from vTxHashes by replacing it with the back and deleting the back.
524
- vTxHashes [it->vTxHashesIdx ] = std::move (vTxHashes .back ());
525
- vTxHashes .pop_back ();
526
- if (vTxHashes .size () * 2 < vTxHashes .capacity ())
527
- vTxHashes .shrink_to_fit ();
520
+ if (txns_randomized .size () > 1 ) {
521
+ // Update idx_randomized of the to-be-moved entry.
522
+ Assert (GetEntry (txns_randomized .back ()->GetHash ()))->idx_randomized = it->idx_randomized ;
523
+ // Remove entry from txns_randomized by replacing it with the back and deleting the back.
524
+ txns_randomized [it->idx_randomized ] = std::move (txns_randomized .back ());
525
+ txns_randomized .pop_back ();
526
+ if (txns_randomized .size () * 2 < txns_randomized .capacity ())
527
+ txns_randomized .shrink_to_fit ();
528
528
} else
529
- vTxHashes .clear ();
529
+ txns_randomized .clear ();
530
530
531
531
totalTxSize -= it->GetTxSize ();
532
532
m_total_fee -= it->GetFee ();
@@ -1054,7 +1054,7 @@ void CCoinsViewMemPool::Reset()
1054
1054
size_t CTxMemPool::DynamicMemoryUsage () const {
1055
1055
LOCK (cs);
1056
1056
// Estimate the overhead of mapTx to be 15 pointers + an allocation, as no exact formula for boost::multi_index_contained is implemented.
1057
- return memusage::MallocUsage (sizeof (CTxMemPoolEntry) + 15 * sizeof (void *)) * mapTx.size () + memusage::DynamicUsage (mapNextTx) + memusage::DynamicUsage (mapDeltas) + memusage::DynamicUsage (vTxHashes ) + cachedInnerUsage;
1057
+ return memusage::MallocUsage (sizeof (CTxMemPoolEntry) + 15 * sizeof (void *)) * mapTx.size () + memusage::DynamicUsage (mapNextTx) + memusage::DynamicUsage (mapDeltas) + memusage::DynamicUsage (txns_randomized ) + cachedInnerUsage;
1058
1058
}
1059
1059
1060
1060
void CTxMemPool::RemoveUnbroadcastTx (const uint256& txid, const bool unchecked) {
0 commit comments