Skip to content

Commit

Permalink
fix: removing unnecessary _eth_getBlockReceipts requests (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaidarkairbek authored Jan 8, 2025
1 parent 61ac283 commit f611b21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/sync-historical/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ export const createHistoricalSync = async (
block: Hash,
transactionHashes: Set<Hash>,
): Promise<SyncTransactionReceipt[]> => {
if (transactionHashes.size === 0) {
return [];
}

if (isBlockReceipts === false) {
const transactionReceipts = await Promise.all(
Array.from(transactionHashes).map((hash) =>
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/sync-realtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@ export const createRealtimeSync = (
blockHash: Hash,
transactionHashes: Set<Hash>,
): Promise<SyncTransactionReceipt[]> => {
if (transactionHashes.size === 0) {
return [];
}

if (isBlockReceipts === false) {
const transactionReceipts = await Promise.all(
Array.from(transactionHashes).map(async (hash) =>
Expand Down

0 comments on commit f611b21

Please sign in to comment.