Rename CTxMemPool::remove -> removeRecursive
This commit is contained in:
@@ -607,7 +607,7 @@ void CTxMemPool::CalculateDescendants(txiter entryit, setEntries &setDescendants
|
||||
}
|
||||
}
|
||||
|
||||
void CTxMemPool::remove(const CTransaction &origTx, std::list<CTransaction>& removed, bool fRecursive)
|
||||
void CTxMemPool::removeRecursive(const CTransaction &origTx, std::list<CTransaction>& removed)
|
||||
{
|
||||
// Remove transaction from memory pool
|
||||
{
|
||||
@@ -616,8 +616,8 @@ void CTxMemPool::remove(const CTransaction &origTx, std::list<CTransaction>& rem
|
||||
txiter origit = mapTx.find(origTx.GetHash());
|
||||
if (origit != mapTx.end()) {
|
||||
txToRemove.insert(origit);
|
||||
} else if (fRecursive) {
|
||||
// If recursively removing but origTx isn't in the mempool
|
||||
} else {
|
||||
// When recursively removing but origTx isn't in the mempool
|
||||
// be sure to remove any children that are in the pool. This can
|
||||
// happen during chain re-orgs if origTx isn't re-accepted into
|
||||
// the mempool for any reason.
|
||||
@@ -631,12 +631,8 @@ void CTxMemPool::remove(const CTransaction &origTx, std::list<CTransaction>& rem
|
||||
}
|
||||
}
|
||||
setEntries setAllRemoves;
|
||||
if (fRecursive) {
|
||||
BOOST_FOREACH(txiter it, txToRemove) {
|
||||
CalculateDescendants(it, setAllRemoves);
|
||||
}
|
||||
} else {
|
||||
setAllRemoves.swap(txToRemove);
|
||||
BOOST_FOREACH(txiter it, txToRemove) {
|
||||
CalculateDescendants(it, setAllRemoves);
|
||||
}
|
||||
BOOST_FOREACH(txiter it, setAllRemoves) {
|
||||
removed.push_back(it->GetTx());
|
||||
@@ -677,7 +673,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
|
||||
}
|
||||
BOOST_FOREACH(const CTransaction& tx, transactionsToRemove) {
|
||||
list<CTransaction> removed;
|
||||
remove(tx, removed, true);
|
||||
removeRecursive(tx, removed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,7 +687,7 @@ void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>
|
||||
const CTransaction &txConflict = *it->second.ptx;
|
||||
if (txConflict != tx)
|
||||
{
|
||||
remove(txConflict, removed, true);
|
||||
removeRecursive(txConflict, removed);
|
||||
ClearPrioritisation(txConflict.GetHash());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user