From 7d9c46824229c66a14f03603e38db3eead4d316b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Tue, 24 May 2022 18:32:38 +0100 Subject: [PATCH] fix: remove cash-in transaction retry --- lib/cash-in/cash-in-tx.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/cash-in/cash-in-tx.js b/lib/cash-in/cash-in-tx.js index 8f7703cb..cc676554 100644 --- a/lib/cash-in/cash-in-tx.js +++ b/lib/cash-in/cash-in-tx.js @@ -148,18 +148,17 @@ function postProcess (r, pi, isBlacklisted, addressReuse, walletScore) { } }) .catch(err => { - // Important: We don't know what kind of error this is - // so not safe to assume that funds weren't sent. - // Therefore, don't set sendPending to false except for - // errors (like InsufficientFundsError) that are guaranteed - // not to send. - const sendPending = err.name !== 'InsufficientFundsError' + // Important: We don't know what kind of error this is + // so not safe to assume that funds weren't sent. + + // Setting sendPending to true ensures that the transaction gets + // silently terminated and no retries are done return { sendTime: 'now()^', error: err.message, errorCode: err.name, - sendPending + sendPending: true } }) .then(sendRec => {