diff --git a/packages/core/src/sync-historical/index.ts b/packages/core/src/sync-historical/index.ts index 2e0e96c6f..9e4ac29a1 100644 --- a/packages/core/src/sync-historical/index.ts +++ b/packages/core/src/sync-historical/index.ts @@ -346,6 +346,10 @@ export const createHistoricalSync = async ( block: Hash, transactionHashes: Set, ): Promise => { + if (transactionHashes.size === 0) { + return []; + } + if (isBlockReceipts === false) { const transactionReceipts = await Promise.all( Array.from(transactionHashes).map((hash) => diff --git a/packages/core/src/sync-realtime/index.ts b/packages/core/src/sync-realtime/index.ts index f92c8e302..2bed20600 100644 --- a/packages/core/src/sync-realtime/index.ts +++ b/packages/core/src/sync-realtime/index.ts @@ -581,6 +581,10 @@ export const createRealtimeSync = ( blockHash: Hash, transactionHashes: Set, ): Promise => { + if (transactionHashes.size === 0) { + return []; + } + if (isBlockReceipts === false) { const transactionReceipts = await Promise.all( Array.from(transactionHashes).map(async (hash) =>