fix: cashout flow out of reach catch

This commit is contained in:
Sérgio Salgado 2022-01-10 16:35:07 +00:00
parent ae8c86a6a7
commit 72610e7376

View file

@ -137,9 +137,15 @@ function getWalletScore (tx, pi) {
dispense: true 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) return pi.isValidWalletScore(tx.walletScore)
.then(isValid => isValid ? tx : _.assign(tx, { .then(isValid => isValid ? tx : _.assign(tx, {
error: 'Ciphertrace score is above defined threshold', error: 'Ciphertrace score is above defined threshold',