Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
fix: Skip GET_SWAP_INFO rpc call if no swaps present
Browse files Browse the repository at this point in the history
  • Loading branch information
binarybaron committed Jun 12, 2024
1 parent 31ef345 commit 86e83be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/cli/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ export async function getSwapInfo(swapId: string) {
export async function getSwapInfoBatch(
swapIds: string[],
): Promise<GetSwapInfoResponse[]> {
if(swapIds.length === 0) {
logger.debug('No swaps present in history, skipping swap info retrieval');
return [];
}

return makeBatchRpcRequest<GetSwapInfoResponse>(
RpcMethod.GET_SWAP_INFO,
swapIds.map((swapId) => ({ swap_id: swapId })),
Expand Down

0 comments on commit 86e83be

Please sign in to comment.