From 200766c5231842b2121f514f8387679805e61b44 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Fri, 20 Oct 2023 23:45:18 +0800 Subject: [PATCH] clear interval --- helpers/tx.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers/tx.ts b/helpers/tx.ts index 914a4d43..f54872d0 100644 --- a/helpers/tx.ts +++ b/helpers/tx.ts @@ -162,7 +162,7 @@ export const trackCCTX = async ( let cctxs: any = {}; let pendingNonces: any = []; - setInterval(async () => { + const intervalID = setInterval(async () => { pendingNonces = await fetchNonces(API, TSS); if (Object.keys(cctxs).length === 0) { if (!json && emitter) { @@ -226,6 +226,8 @@ export const trackCCTX = async ( }) .every((s) => s === "OutboundMined"); + clearInterval(intervalID); + if (!allOutboundMined) { reject("CCTX aborted or reverted"); } else {