From d8b422250c4faabee40dc58c7396c132545aca55 Mon Sep 17 00:00:00 2001 From: Fahrzin Hemmati Date: Fri, 4 Aug 2023 16:10:27 -0700 Subject: [PATCH] Handle transactions that timeout without starting --- src/websocket/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/websocket/index.ts b/src/websocket/index.ts index 391a08d..564fad5 100644 --- a/src/websocket/index.ts +++ b/src/websocket/index.ts @@ -265,7 +265,7 @@ export const addWebsocketServer = (env: RouteInitEnvironment) => { finish: undefined, timeout: setTimeout(() => { delete client.transactions[tx.id]; - tx.finish(); // Finish without value cancels the transaction + tx.finish && tx.finish(); // Finish without value cancels the transaction env.log.error(LOG_ACTION, 'timeout', LOG_DETAILS); serverManager.send(event.socket, 'tx_error', { id: tx.id, reason: 'timeout' }); }, TRANSACTION_TIMEOUT_MS),