This commit is contained in:
Josh Harvey 2016-11-27 17:06:46 +02:00
parent 493e669e6d
commit 3a99b7a6bc

View file

@ -257,8 +257,8 @@ function fiatBalance (settings, fiatCode, cryptoCode, deviceId) {
})
}
function processTxStatus (tx) {
return wallet.getStatus(tx.toAddress, tx.cryptoAtoms, tx.cryptoCode)
function processTxStatus (settings, tx) {
return wallet.getStatus(settings, tx.toAddress, tx.cryptoAtoms, tx.cryptoCode)
.then(res => db.updateTxStatus(tx, res.status))
}
@ -279,16 +279,24 @@ function notifyConfirmation (tx) {
function monitorLiveIncoming () {
const statuses = ['notSeen', 'published', 'insufficientFunds']
db.fetchOpenTxs(statuses, STALE_LIVE_INCOMING_TX_AGE)
.then(txs => Promise.all(txs.map(processTxStatus)))
.catch(err => logger.error(err))
return settingsLoader.settings()
.then(settings => {
return db.fetchOpenTxs(statuses, STALE_LIVE_INCOMING_TX_AGE)
.then(txs => Promise.all(txs.map(r => processTxStatus(settings, r))))
})
.catch(logger.error)
}
function monitorIncoming () {
const statuses = ['notSeen', 'published', 'authorized', 'instant', 'rejected', 'insufficientFunds']
db.fetchOpenTxs(statuses, STALE_INCOMING_TX_AGE)
.then(txs => Promise.all(txs.map(processTxStatus)))
.catch(err => logger.error(err))
return settingsLoader.settings()
.then(settings => {
db.fetchOpenTxs(statuses, STALE_INCOMING_TX_AGE)
.then(txs => Promise.all(txs.map(r => processTxStatus(settings, r))))
})
.catch(logger.error)
}
function monitorUnnotified () {