Handle transactions that timeout without starting

This commit is contained in:
Fahrzin Hemmati 2023-08-04 16:10:27 -07:00 committed by GitHub
parent 9a4befe652
commit d8b422250c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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),