aboutsummaryrefslogtreecommitdiff
path: root/src/policy/rbf.cpp
diff options
context:
space:
mode:
authorstickies-v <stickies-v@protonmail.com>2022-10-24 18:03:07 +0100
committerstickies-v <stickies-v@protonmail.com>2022-12-13 15:44:45 +0000
commit47c4b1f52ab8d95d7deef83050bad49d1e3e5990 (patch)
treec8054013efcefa3c56a03dd30752a3fec02e3654 /src/policy/rbf.cpp
parent5481f65849313ff947f38433b1ac28285a7f7694 (diff)
downloadbitcoin-47c4b1f52ab8d95d7deef83050bad49d1e3e5990.tar.xz
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.
Diffstat (limited to 'src/policy/rbf.cpp')
-rw-r--r--src/policy/rbf.cpp7
1 files changed, 3 insertions, 4 deletions
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 <util/rbf.h>
#include <limits>
-#include <utility>
#include <vector>
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())) {