Skip to content

Commit

Permalink
Merge pull request #84 from kev1n-peters/solana-old-blocks-fix
Browse files Browse the repository at this point in the history
Add check for old blocks being pruned
  • Loading branch information
0xngmi authored Dec 4, 2023
2 parents f96f706 + b726e7b commit 69cd463
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 69cd463

Please sign in to comment.