aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index a7056554ad..63a26da326 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -1137,7 +1137,7 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<uint256>* pvNoSpendsRe
bool CTxMemPool::TransactionWithinChainLimit(const uint256& txid, size_t chainLimit) const {
LOCK(cs);
- if (exists(txid) && std::max(mapTx.find(txid)->GetCountWithAncestors(), mapTx.find(txid)->GetCountWithDescendants()) >= chainLimit)
- return false;
- return true;
+ auto it = mapTx.find(txid);
+ return it == mapTx.end() || (it->GetCountWithAncestors() < chainLimit &&
+ it->GetCountWithDescendants() < chainLimit);
}