MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / removeUnchecked

Method removeUnchecked

src/txmempool.cpp:414–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
415{
416 NotifyEntryRemoved(it->GetSharedTx(), reason);
417 const uint256 hash = it->GetTx().GetHash();
418 for (const CTxIn& txin : it->GetTx().vin)
419 mapNextTx.erase(txin.prevout);
420
421 if (vTxHashes.size() > 1) {
422 vTxHashes[it->vTxHashesIdx] = std::move(vTxHashes.back());
423 vTxHashes[it->vTxHashesIdx].second->vTxHashesIdx = it->vTxHashesIdx;
424 vTxHashes.pop_back();
425 if (vTxHashes.size() * 2 < vTxHashes.capacity())
426 vTxHashes.shrink_to_fit();
427 } else
428 vTxHashes.clear();
429
430 totalTxSize -= it->GetTxSize();
431 cachedInnerUsage -= it->DynamicMemoryUsage();
432 cachedInnerUsage -= memusage::DynamicUsage(mapLinks[it].parents) + memusage::DynamicUsage(mapLinks[it].children);
433 mapLinks.erase(it);
434 mapTx.erase(it);
435 nTransactionsUpdated++;
436 if (minerPolicyEstimator) {minerPolicyEstimator->removeTx(hash, false);}
437}
438
439// Calculates descendants of entry that are not already in setDescendants, and adds to
440// setDescendants. Assumes entryit is already a tx in the mempool and setMemPoolChildren

Callers

nothing calls this directly

Calls 12

DynamicUsageFunction · 0.85
GetSharedTxMethod · 0.80
removeTxMethod · 0.80
GetHashMethod · 0.45
eraseMethod · 0.45
sizeMethod · 0.45
pop_backMethod · 0.45
capacityMethod · 0.45
shrink_to_fitMethod · 0.45
clearMethod · 0.45
GetTxSizeMethod · 0.45
DynamicMemoryUsageMethod · 0.45

Tested by

no test coverage detected