Skip to content

Commit

Permalink
fix: check newest sig for initial batch
Browse files Browse the repository at this point in the history
  • Loading branch information
swimricky committed Nov 18, 2023
1 parent 732e803 commit 2d87c64
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/claim_sdk/eventSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down

0 comments on commit 2d87c64

Please sign in to comment.