Skip to content

Commit

Permalink
Filtering pending txs
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenKor committed Sep 4, 2024
1 parent bf3307e commit 6f7fbae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zp-relayer/services/relayer/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ async function getTransactionsV2(req: Request, res: Response, { pool }: PoolInje
}
const indexerTxs: string[] = await response.json()

const txStore = (pool as RelayPool).txStore
const localEntries = Object.entries(await txStore.getAll());
const lastRequestedIndex = offset + limit * OUTPLUSONE;
const txStore = (pool as RelayPool).txStore;
const localEntries = await txStore.getAll().then(entries =>
Object.entries(entries)
.filter(([commit, {memo, index}]) => offset <= index && index < lastRequestedIndex)
);

const indexerCommitments = indexerTxs.map(tx => tx.slice(65, 129));
const optimisticTxs: string[] = []
Expand Down

0 comments on commit 6f7fbae

Please sign in to comment.