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
2022-10-24 18:03:07 +01:00
parent 5481f65849
commit 47c4b1f52a
4 changed files with 9 additions and 16 deletions

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);