MCPcopy Create free account
hub / github.com/LUX-Core/lux / removeRecursive

Method removeRecursive

src/txmempool.cpp:503–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503void CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReason reason)
504{
505 // Remove transaction from memory pool
506 {
507 LOCK(cs);
508 setEntries txToRemove;
509 txiter origit = mapTx.find(origTx.GetHash());
510 if (origit != mapTx.end()) {
511 txToRemove.insert(origit);
512 } else {
513 // When recursively removing but origTx isn't in the mempool
514 // be sure to remove any children that are in the pool. This can
515 // happen during chain re-orgs if origTx isn't re-accepted into
516 // the mempool for any reason.
517 for (unsigned int i = 0; i < origTx.vout.size(); i++) {
518 auto it = mapNextTx.find(COutPoint(origTx.GetHash(), i));
519 if (it == mapNextTx.end())
520 continue;
521 txiter nextit = mapTx.find(it->second->GetHash());
522 assert(nextit != mapTx.end());
523 txToRemove.insert(nextit);
524 }
525 }
526 setEntries setAllRemoves;
527 for (txiter it : txToRemove) {
528 CalculateDescendants(it, setAllRemoves);
529 }
530
531 RemoveStaged(setAllRemoves, false, reason);
532 }
533}
534
535void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags)
536{

Callers 3

DisconnectTipFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
TestPackageSelectionFunction · 0.80

Calls 6

COutPointClass · 0.70
findMethod · 0.45
GetHashMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
TestPackageSelectionFunction · 0.64