Merge pull request #1138 from chaotixkilla/feat-cashout-nil-cryptovalue-check

Add cryptoAtoms positive value sanity check
This commit is contained in:
Rafael Taranto 2022-03-03 15:08:10 +00:00 committed by GitHub
commit b637b728ec

View file

@ -192,7 +192,9 @@ function getStatus (settings, tx, machineId) {
? 'published'
: 'rejected'
const status = isAuthorized ? 'authorized' : unauthorizedStatus
// Sanity check to confirm if there's any cryptoatoms for which to dispense bills
const authorizedStatus = isAuthorized ? 'authorized' : unauthorizedStatus
const status = BN(tx.cryptoAtoms).gt(0) ? authorizedStatus : 'rejected'
return { receivedCryptoAtoms: statusRec.receivedCryptoAtoms, status }
})