Merge pull request #5907 from mempool/mononaut/acceleration-history-sanity-check

This commit is contained in:
wiz
2025-05-10 15:53:21 -10:00
committed by GitHub

View File

@@ -169,9 +169,10 @@ export class ServicesApiServices {
page,
total: parseInt(response.headers.get('X-Total-Count'), 10) || 0,
accelerations: accelerations.concat(response.body || []),
pageAccelerations: response.body || [],
})),
switchMap(({page, total, accelerations}) => {
if (accelerations.length >= Math.min(total, limit ?? Infinity) || (findTxid && accelerations.find((acc) => acc.txid === findTxid))) {
switchMap(({page, total, accelerations, pageAccelerations }) => {
if (pageAccelerations.length === 0 || accelerations.length >= Math.min(total, limit ?? Infinity) || (findTxid && accelerations.find((acc) => acc.txid === findTxid))) {
return of({ page, total, accelerations });
} else {
return getPage$(page + 1, accelerations);