From 762fda8e10d7484ab4b58de620b488d78c16471d Mon Sep 17 00:00:00 2001 From: Paul Puey Date: Sat, 27 Jul 2024 23:42:49 -0500 Subject: [PATCH] Fix Changenow --- src/partners/changenow.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/partners/changenow.ts b/src/partners/changenow.ts index a07195d1..7c999ad8 100644 --- a/src/partners/changenow.ts +++ b/src/partners/changenow.ts @@ -97,6 +97,9 @@ export const queryChangeNow = async ( const result = await response.json() const txs = asChangeNowResult(result).exchanges + if (txs.length === 0) { + break + } for (const rawTx of txs) { let tx: ChangeNowTx try { @@ -130,11 +133,8 @@ export const queryChangeNow = async ( latestIsoDate = ssTx.isoDate } } - datelog(`ChangeNow latestIsoDate ${latestIsoDate}`) - offset += LIMIT - if (txs.length < LIMIT) { - break - } + datelog(`ChangeNow offset ${offset} latestIsoDate ${latestIsoDate}`) + offset += txs.length retry = 0 } catch (e) { datelog(e)