Skip to content

Commit 1f86d64

Browse files
committed
Merge #8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
2 parents 94ab58b + ad0752e commit 1f86d64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<uint256>* pvNoSpendsRe
10751075

10761076
unsigned nTxnRemoved = 0;
10771077
CFeeRate maxFeeRateRemoved(0);
1078-
while (DynamicMemoryUsage() > sizelimit) {
1078+
while (!mapTx.empty() && DynamicMemoryUsage() > sizelimit) {
10791079
indexed_transaction_set::index<descendant_score>::type::iterator it = mapTx.get<descendant_score>().begin();
10801080

10811081
// We set the new mempool min fee to the feerate of the removed set, plus the

0 commit comments

Comments
 (0)