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.
This commit is contained in:
stickies-v committed 2022-12-13 15:44:45 +00:00
1 parent 5481f65849
commit 47c4b1f52a
4 files changed
+9 -16

No files matched your search

+1 -2
View File
@@ -394,8 +394,7 @@ void BlockAssembler::addPackageTxs(const CTxMemPool& mempool, int& nPackagesSele
continue;
}
auto ancestors_result{mempool.CalculateMemPoolAncestors(*iter, CTxMemPool::Limits::NoLimits(), /*fSearchForParents=*/false)};
auto ancestors{std::move(ancestors_result).value_or(CTxMemPool::setEntries{})};
auto ancestors{mempool.AssumeCalculateMemPoolAncestors(__func__, *iter, CTxMemPool::Limits::NoLimits(), /*fSearchForParents=*/false)};
onlyUnconfirmed(ancestors);
ancestors.insert(iter);