aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-06-05 11:42:24 -0400
committerMatt Corallo <git@bluematt.me>2017-06-05 21:46:14 -0400
commitec1271f2bea52d43bd24fb93d32d24168f8c6a74 (patch)
treebcd29f3969091ee0c818ed7707b4eef0998f1840 /src/txmempool.cpp
parent9fec4da0bec93a49798b5f5e92cf76e900759ee4 (diff)
Remove useless mapNextTx lookup in CTxMemPool::TrimToSize.
Prior to per-utxo CCoins, we checked that no other in-mempool tx spent any of the given transaction's outputs, as we don't want to uncache that entire tx in such a case. However, we now are checking only that there exists no other mempool spends of the same output, which should clearly be impossible after we removed the transaction which was spending said output (barring massive mempool inconsistency). Thanks to @sdaftuar for the suggestion.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 17389db9f0..1f2cd958ee 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -1050,9 +1050,7 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpends
BOOST_FOREACH(const CTransaction& tx, txn) {
BOOST_FOREACH(const CTxIn& txin, tx.vin) {
if (exists(txin.prevout.hash)) continue;
- if (!mapNextTx.count(txin.prevout)) {
- pvNoSpendsRemaining->push_back(txin.prevout);
- }
+ pvNoSpendsRemaining->push_back(txin.prevout);
}
}
}