hotfix: add fudge factor

This commit is contained in:
Taranto 2020-02-11 21:06:30 +00:00 committed by Josh Harvey
parent bf341476bb
commit fa69d2a030
18 changed files with 650 additions and 249 deletions

View file

@ -124,10 +124,10 @@ function getStatus (account, toAddress, requested, cryptoCode) {
const confirmed = _.compose(sum, toBn, filterConfirmed)(transfers)
const pending = _.compose(sum, toBn, filterPending)(transfers)
if (confirmed.gte(requested)) return { status: 'confirmed' }
if (pending.gte(requested)) return { status: 'authorized' }
if (pending.gt(0)) return { status: 'insufficientFunds' }
return { status: 'notSeen' }
if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' }
if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' }
if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' }
return { receivedCryptoAtoms: pending, status: 'notSeen' }
})
}