diff options
author | stickies-v <stickies-v@protonmail.com> | 2022-10-24 18:03:07 +0100 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2022-12-13 15:44:45 +0000 |
commit | 47c4b1f52ab8d95d7deef83050bad49d1e3e5990 (patch) | |
tree | c8054013efcefa3c56a03dd30752a3fec02e3654 /src/rpc | |
parent | 5481f65849313ff947f38433b1ac28285a7f7694 (diff) |
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/rpc')
-rw-r--r-- | src/rpc/mempool.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp index af980de6b9..7584c9c772 100644 --- a/src/rpc/mempool.cpp +++ b/src/rpc/mempool.cpp @@ -451,8 +451,7 @@ static RPCHelpMan getmempoolancestors() throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not in mempool"); } - auto ancestors_result{mempool.CalculateMemPoolAncestors(*it, CTxMemPool::Limits::NoLimits(), /*fSearchForParents=*/false)}; - auto ancestors{std::move(ancestors_result).value_or(CTxMemPool::setEntries{})}; + auto ancestors{mempool.AssumeCalculateMemPoolAncestors(__func__, *it, CTxMemPool::Limits::NoLimits(), /*fSearchForParents=*/false)}; if (!fVerbose) { UniValue o(UniValue::VARR); |