From 47c4b1f52ab8d95d7deef83050bad49d1e3e5990 Mon Sep 17 00:00:00 2001 From: stickies-v Date: Mon, 24 Oct 2022 18:03:07 +0100 Subject: mempool: log/halt when CalculateMemPoolAncestors fails unexpectedly When CalculateMemPoolAncestors fails unexpectedly (e.g. it exceeds ancestor/descendant limits even though we expect no limits to be applied), add an error log entry for increased visibility. For debug builds, the application will even halt completely since this is not supposed to happen. --- src/policy/rbf.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/policy/rbf.cpp') diff --git a/src/policy/rbf.cpp b/src/policy/rbf.cpp index bdaf2d0a30..5211c18743 100644 --- a/src/policy/rbf.cpp +++ b/src/policy/rbf.cpp @@ -16,7 +16,6 @@ #include #include -#include #include RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) @@ -36,9 +35,9 @@ RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) // If all the inputs have nSequence >= maxint-1, it still might be // signaled for RBF if any unconfirmed parents have signaled. - CTxMemPoolEntry entry = *pool.mapTx.find(tx.GetHash()); - auto ancestors_result{pool.CalculateMemPoolAncestors(entry, CTxMemPool::Limits::NoLimits(), /*fSearchForParents=*/false)}; - auto ancestors{std::move(ancestors_result).value_or(CTxMemPool::setEntries{})}; + const CTxMemPoolEntry entry{*pool.mapTx.find(tx.GetHash())}; + auto ancestors{pool.AssumeCalculateMemPoolAncestors(__func__, entry, CTxMemPool::Limits::NoLimits(), + /*fSearchForParents=*/false)}; for (CTxMemPool::txiter it : ancestors) { if (SignalsOptInRBF(it->GetTx())) { -- cgit v1.2.3