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

Method removeRecursive

src/txmempool.cpp:468–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466}
467
468void CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReason reason)
469{
470 // Remove transaction from memory pool
471 {
472 LOCK(cs);
473 setEntries txToRemove;
474 txiter origit = mapTx.find(origTx.GetHash());
475 if (origit != mapTx.end()) {
476 txToRemove.insert(origit);
477 } else {
478 // When recursively removing but origTx isn't in the mempool
479 // be sure to remove any children that are in the pool. This can
480 // happen during chain re-orgs if origTx isn't re-accepted into
481 // the mempool for any reason.
482 for (unsigned int i = 0; i < origTx.vout.size(); i++) {
483 auto it = mapNextTx.find(COutPoint(origTx.GetHash(), i));
484 if (it == mapNextTx.end())
485 continue;
486 txiter nextit = mapTx.find(it->second->GetHash());
487 assert(nextit != mapTx.end());
488 txToRemove.insert(nextit);
489 }
490 }
491 setEntries setAllRemoves;
492 for (txiter it : txToRemove) {
493 CalculateDescendants(it, setAllRemoves);
494 }
495
496 RemoveStaged(setAllRemoves, false, reason);
497 }
498}
499
500void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags)
501{

Callers 5

UpdateMempoolForReorgFunction · 0.80
DisconnectTipMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
miner_tests.cppFile · 0.80
BOOST_AUTO_TEST_CASEFunction · 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
BOOST_AUTO_TEST_CASEFunction · 0.64