From 2d87c64b53c089abecbe43ce54a45ce165591bfc Mon Sep 17 00:00:00 2001 From: swimricky Date: Sat, 18 Nov 2023 09:09:06 -0500 Subject: [PATCH] fix: check newest sig for initial batch --- frontend/claim_sdk/eventSubscriber.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/claim_sdk/eventSubscriber.ts b/frontend/claim_sdk/eventSubscriber.ts index 4052ba2e..f79136bd 100644 --- a/frontend/claim_sdk/eventSubscriber.ts +++ b/frontend/claim_sdk/eventSubscriber.ts @@ -56,13 +56,13 @@ export class TokenDispenserEventSubscriber { {}, this.connection.commitment as anchor.web3.Finality ) - const currentBatchLastSig = currentBatch[currentBatch.length - 1]?.signature - const currentBatchLastSigBlockTime = await this.getTransactionBlockTime( - currentBatchLastSig + const initialBatchNewestSig = currentBatch[0]?.signature + const initialBatchNewestSigBlockTime = await this.getTransactionBlockTime( + initialBatchNewestSig ) if ( - currentBatchLastSigBlockTime && - currentBatchLastSigBlockTime < currentTimeSec - this.timeWindowSecs + initialBatchNewestSigBlockTime && + initialBatchNewestSigBlockTime < currentTimeSec - this.timeWindowSecs ) { return { txnEvents: [],