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