From 86e83be21df5ccd764b2fa80542ebc31043ffec2 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Wed, 12 Jun 2024 18:29:03 +0200 Subject: [PATCH] fix: Skip GET_SWAP_INFO rpc call if no swaps present --- src/main/cli/rpc.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/cli/rpc.ts b/src/main/cli/rpc.ts index 365df6a..e4bf0e7 100644 --- a/src/main/cli/rpc.ts +++ b/src/main/cli/rpc.ts @@ -236,6 +236,11 @@ export async function getSwapInfo(swapId: string) { export async function getSwapInfoBatch( swapIds: string[], ): Promise { + if(swapIds.length === 0) { + logger.debug('No swaps present in history, skipping swap info retrieval'); + return []; + } + return makeBatchRpcRequest( RpcMethod.GET_SWAP_INFO, swapIds.map((swapId) => ({ swap_id: swapId })),