Skip to content

Commit 69cd463

Browse files
authored
Merge pull request #84 from kev1n-peters/solana-old-blocks-fix
Add check for old blocks being pruned
2 parents f96f706 + b726e7b commit 69cd463

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/adapters/portal/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ interface SolanaEvent {
278278
}
279279

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

0 commit comments

Comments
 (0)