fix promise stuff; fix db crypto/fiat bug

This commit is contained in:
Josh Harvey 2016-05-31 15:41:56 +03:00
parent a0961ce2e2
commit f17cfdfaa9
3 changed files with 30 additions and 24 deletions

View file

@ -132,15 +132,19 @@ function send (req, res) {
var tx = req.body
tx.cryptoAtoms = new BigNumber(tx.cryptoAtoms)
plugins.sendCoins(session(req), tx, function (err, status) {
// TODO: use status.statusCode here after confirming machine compatibility
// FIX: (joshm) set txHash to status.txId instead of previous status.txHash which wasn't being set
// Need to clean up txHash vs txId
// TODO: use status.statusCode here after confirming machine compatibility
// FIX: (joshm) set txHash to status.txId instead of previous status.txHash which wasn't being set
// Need to clean up txHash vs txId
return plugins.sendCoins(session(req), tx)
.then(status => res.json({
txHash: status && status.txHash,
txId: status && status.txId
}))
.catch(err => {
logger.error(err)
res.json({
errType: err && err.name,
err: err && err.message,
txHash: status && status.txHash,
txId: status && status.txId
err: err.message,
errType: err.name
})
})
}