From 72610e73768ab6c622c2ef5d684e801ac84ef752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Mon, 10 Jan 2022 16:35:07 +0000 Subject: [PATCH] fix: cashout flow out of reach catch --- lib/cash-out/cash-out-tx.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/cash-out/cash-out-tx.js b/lib/cash-out/cash-out-tx.js index 34077546..c7236b91 100644 --- a/lib/cash-out/cash-out-tx.js +++ b/lib/cash-out/cash-out-tx.js @@ -137,9 +137,15 @@ function getWalletScore (tx, pi) { dispense: true }) }) + .catch(() => _.assign(tx, { + walletScore: 10, + error: 'Ciphertrace services not available', + errorCode: 'operatorCancel', + dispense: true + })) } - if (tx.status !== 'notSeen' && !_.isNil(tx.walletScore)) { + if (_.includes(tx.status, statuses) && !_.isNil(tx.walletScore)) { return pi.isValidWalletScore(tx.walletScore) .then(isValid => isValid ? tx : _.assign(tx, { error: 'Ciphertrace score is above defined threshold',