aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-08-15 13:10:57 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-10-21 19:22:43 -0700
commit51f278329d43398428d60f5986f8d29a2041d28d (patch)
treebed01adf0a9ef92f90711dc08ca05934c582da6f /src/txmempool.cpp
parentf48211b700d171f7bcee7d3088269fdaaf1b5c13 (diff)
downloadbitcoin-51f278329d43398428d60f5986f8d29a2041d28d.tar.xz
Make removed and conflicted arguments optional to remove
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 9816c9dcbb..193542ee5e 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -503,7 +503,7 @@ void CTxMemPool::CalculateDescendants(txiter entryit, setEntries &setDescendants
}
}
-void CTxMemPool::removeRecursive(const CTransaction &origTx, std::list<CTransaction>& removed)
+void CTxMemPool::removeRecursive(const CTransaction &origTx, std::list<CTransaction>* removed)
{
// Remove transaction from memory pool
{
@@ -530,8 +530,10 @@ void CTxMemPool::removeRecursive(const CTransaction &origTx, std::list<CTransact
BOOST_FOREACH(txiter it, txToRemove) {
CalculateDescendants(it, setAllRemoves);
}
- BOOST_FOREACH(txiter it, setAllRemoves) {
- removed.push_back(it->GetTx());
+ if (removed) {
+ BOOST_FOREACH(txiter it, setAllRemoves) {
+ removed->push_back(it->GetTx());
+ }
}
RemoveStaged(setAllRemoves, false);
}
@@ -574,7 +576,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
RemoveStaged(setAllRemoves, false);
}
-void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>& removed)
+void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>* removed)
{
// Remove transactions which depend on inputs of tx, recursively
LOCK(cs);
@@ -595,7 +597,7 @@ void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>
* Called when a block is connected. Removes from mempool and updates the miner fee estimator.
*/
void CTxMemPool::removeForBlock(const std::vector<CTransaction>& vtx, unsigned int nBlockHeight,
- std::list<CTransaction>& conflicts, bool fCurrentEstimate)
+ std::list<CTransaction>* conflicts, bool fCurrentEstimate)
{
LOCK(cs);
std::vector<CTxMemPoolEntry> entries;