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

@ -158,13 +158,13 @@ function getStatus (account, toAddress, cryptoAtoms, cryptoCode) {
return checkCryptoCode(cryptoCode)
.then(() => confirmedBalance(toAddress))
.then(confirmed => {
if (confirmed.gte(cryptoAtoms)) return {status: 'confirmed'}
if (confirmed.gte(cryptoAtoms)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' }
return pendingBalance(toAddress)
.then(pending => {
if (pending.gte(cryptoAtoms)) return {status: 'published'}
if (pending.gt(0)) return {status: 'insufficientFunds'}
return {status: 'notSeen'}
if (pending.gte(cryptoAtoms)) return { receivedCryptoAtoms: pending, status: 'published' }
if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' }
return { receivedCryptoAtoms: pending, status: 'notSeen' }
})
})
}