Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | void CTxMemPool::removeForReorg(const Config &config, | ||||
for (txiter it : txToRemove) { | for (txiter it : txToRemove) { | ||||
CalculateDescendants(it, setAllRemoves); | CalculateDescendants(it, setAllRemoves); | ||||
} | } | ||||
RemoveStaged(setAllRemoves, false, MemPoolRemovalReason::REORG); | RemoveStaged(setAllRemoves, false, MemPoolRemovalReason::REORG); | ||||
} | } | ||||
void CTxMemPool::removeConflicts(const CTransaction &tx) { | void CTxMemPool::removeConflicts(const CTransaction &tx) { | ||||
// Remove transactions which depend on inputs of tx, recursively | // Remove transactions which depend on inputs of tx, recursively | ||||
LOCK(cs); | AssertLockHeld(cs); | ||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
auto it = mapNextTx.find(txin.prevout); | auto it = mapNextTx.find(txin.prevout); | ||||
if (it != mapNextTx.end()) { | if (it != mapNextTx.end()) { | ||||
const CTransaction &txConflict = *it->second; | const CTransaction &txConflict = *it->second; | ||||
if (txConflict != tx) { | if (txConflict != tx) { | ||||
ClearPrioritisation(txConflict.GetId()); | ClearPrioritisation(txConflict.GetId()); | ||||
removeRecursive(txConflict, MemPoolRemovalReason::CONFLICT); | removeRecursive(txConflict, MemPoolRemovalReason::CONFLICT); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 776 Lines • Show Last 20 Lines |