txId bug fixes; debugging

This commit is contained in:
Josh Harvey 2016-07-29 18:44:26 +03:00
parent 572bd7a10f
commit 3d9c95ba7f
4 changed files with 20 additions and 11 deletions

View file

@ -133,15 +133,17 @@ function send (req, res) {
const tx = req.body
tx.cryptoAtoms = new BigNumber(tx.cryptoAtoms)
// 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(getDeviceId(req), tx)
.then(status => res.json({
txHash: status && status.txHash,
txId: status && status.txId
}))
.then(status => {
console.log('DEBUG14: %j', status)
res.json({
txHash: status && status.txHash,
txId: status && status.txId
})
})
.catch(err => {
console.log('DEBUG15: %s', err)
logger.error(err)
res.json({
err: err.message,