diff --git a/src/txmempool.cpp b/src/txmempool.cpp index df90683a406..7f259369357 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -198,7 +198,7 @@ void CTxMemPool::Apply(ChangeSet* changeset) AssertLockHeld(cs); m_txgraph->CommitStaging(); - RemoveStaged(changeset->m_to_remove, false, MemPoolRemovalReason::REPLACED); + RemoveStaged(changeset->m_to_remove, MemPoolRemovalReason::REPLACED); for (size_t i=0; im_entry_vec.size(); ++i) { auto tx_entry = changeset->m_entry_vec[i]; @@ -336,7 +336,7 @@ void CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReaso CalculateDescendants(it, setAllRemoves); } - RemoveStaged(setAllRemoves, false, reason); + RemoveStaged(setAllRemoves, reason); } void CTxMemPool::removeForReorg(CChain& chain, std::function check_final_and_mature) @@ -354,7 +354,7 @@ void CTxMemPool::removeForReorg(CChain& chain, std::function check for (txiter it : txToRemove) { CalculateDescendants(it, setAllRemoves); } - RemoveStaged(setAllRemoves, false, MemPoolRemovalReason::REORG); + RemoveStaged(setAllRemoves, MemPoolRemovalReason::REORG); for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) { assert(TestLockPointValidity(chain, it->GetLockPoints())); } @@ -392,7 +392,7 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigne setEntries stage; stage.insert(it); txs_removed_for_block.emplace_back(*it); - RemoveStaged(stage, true, MemPoolRemovalReason::BLOCK); + RemoveStaged(stage, MemPoolRemovalReason::BLOCK); } removeConflicts(*tx); ClearPrioritisation(tx->GetHash()); @@ -744,7 +744,7 @@ void CTxMemPool::RemoveUnbroadcastTx(const Txid& txid, const bool unchecked) { } } -void CTxMemPool::RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason) { +void CTxMemPool::RemoveStaged(setEntries &stage, MemPoolRemovalReason reason) { AssertLockHeld(cs); for (txiter it : stage) { removeUnchecked(it, reason); @@ -776,7 +776,7 @@ int CTxMemPool::Expire(std::chrono::seconds time) for (txiter removeit : toremove) { CalculateDescendants(removeit, stage); } - RemoveStaged(stage, false, MemPoolRemovalReason::EXPIRY); + RemoveStaged(stage, MemPoolRemovalReason::EXPIRY); return stage.size(); } diff --git a/src/txmempool.h b/src/txmempool.h index c305d5d448a..064ea9ae8db 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -578,10 +578,8 @@ private: * If a transaction is in this set, then all in-mempool descendants must * also be in the set, unless this transaction is being removed for being * in a block. - * Set updateDescendants to true when removing a tx that was in a block, so - * that any in-mempool descendants have their ancestor state updated. */ - void RemoveStaged(setEntries& stage, bool updateDescendants, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs); + void RemoveStaged(setEntries& stage, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs); /** Before calling removeUnchecked for a given transaction, * UpdateForRemoveFromMempool must be called on the entire (dependent) set