Skip to content

Commit

Permalink
Add check for old blocks being pruned
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters committed Dec 4, 2023
1 parent f96f706 commit b726e7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/adapters/portal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ interface SolanaEvent {
}

const getSolanaEvents = async (fromSlot: number, toSlot: number): Promise<EventData[]> => {
// Old blocks may have been pruned by the RPC
if (fromSlot < 233000000) {
return [];
}
const response = await axios.get<SolanaEvent[]>(
`https://europe-west3-wormhole-message-db-mainnet.cloudfunctions.net/get-solana-events?fromSlot=${fromSlot}&toSlot=${toSlot}`
);
Expand Down

0 comments on commit b726e7b

Please sign in to comment.