WIP
This commit is contained in:
parent
5312086622
commit
dbcfa6a7e7
3 changed files with 56 additions and 58 deletions
|
|
@ -359,7 +359,7 @@ exports.sendCoins = function sendCoins (rawTx) {
|
|||
return executeTx(rawTx)
|
||||
}
|
||||
|
||||
exports.cashOut = function cashOut (tx) {
|
||||
exports.cashOut = function cashOut (deviceId, tx) {
|
||||
const cryptoCode = tx.cryptoCode || 'BTC'
|
||||
const walletPlugin = walletPlugins[cryptoCode]
|
||||
|
||||
|
|
@ -379,7 +379,7 @@ exports.cashOut = function cashOut (tx) {
|
|||
if (err) return reject(err)
|
||||
|
||||
const newTx = R.assoc('toAddress', address, tx)
|
||||
return db.addInitialIncoming(newTx, address)
|
||||
return db.addInitialIncoming(deviceId, newTx, address)
|
||||
.then(() => resolve(address))
|
||||
})
|
||||
}))
|
||||
|
|
@ -781,9 +781,7 @@ exports.fetchPhoneTx = function fetchPhoneTx (phone) {
|
|||
})
|
||||
}
|
||||
|
||||
exports.fetchTx = function fetchTx (session) {
|
||||
return db.fetchTx(session)
|
||||
}
|
||||
exports.fetchTx = db.fetchTx
|
||||
|
||||
exports.requestDispense = function requestDispense (tx) {
|
||||
return db.addDispenseRequest(tx)
|
||||
|
|
@ -805,7 +803,7 @@ function sweepHD (row) {
|
|||
.then(txHash => {
|
||||
if (txHash) {
|
||||
logger.debug('[%s] Swept address with tx: %s', cryptoCode, txHash)
|
||||
return db.markSwept(row.session_id)
|
||||
return db.markSwept(row.tx_id)
|
||||
}
|
||||
})
|
||||
.catch(err => logger.error('[%s] Sweep error: %s', cryptoCode, err.message))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue