From 1bf4855016e777dd8b424fe01750f9e3e97931a2 Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 30 Aug 2023 16:08:58 +0100 Subject: [PATCH] [refactor] use CheckPackageLimits for checkChainLimits The behavior is the same as CalculateMemPoolAncestors. The only difference is the string returned, and the string is discarded anyway since checkChainLimits only cares about pass/fail. --- src/node/interfaces.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 153b4728ab..4c83df7eca 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -703,9 +703,9 @@ public: if (!m_node.mempool) return true; LockPoints lp; CTxMemPoolEntry entry(tx, 0, 0, 0, 0, false, 0, lp); - const CTxMemPool::Limits& limits{m_node.mempool->m_limits}; LOCK(m_node.mempool->cs); - return m_node.mempool->CalculateMemPoolAncestors(entry, limits).has_value(); + std::string err_string; + return m_node.mempool->CheckPackageLimits({tx}, entry.GetTxSize(), err_string); } CFeeRate estimateSmartFee(int num_blocks, bool conservative, FeeCalculation* calc) override {