From 1c7c5b39ff25ae4a0cbe75740da9c67967819567 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 1 Oct 2014 11:08:56 -0300 Subject: [PATCH] fix txid response --- js/models/Insight.js | 4 ++-- js/models/Wallet.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/models/Insight.js b/js/models/Insight.js index 79967176b..10d0e3f8c 100644 --- a/js/models/Insight.js +++ b/js/models/Insight.js @@ -197,8 +197,8 @@ Insight.prototype.broadcast = function(rawtx, cb) { this.requestPost('/api/tx/send', { rawtx: rawtx }, function(err, res, body) { - if (err || res.statusCode != 200) cb(err || res); - cb(null, body.txid); + if (err || res.status != 200) cb(err || res); + cb(null, body ? body.txid: null); }); }; diff --git a/js/models/Wallet.js b/js/models/Wallet.js index 075372c44..a40d7cd61 100644 --- a/js/models/Wallet.js +++ b/js/models/Wallet.js @@ -341,7 +341,7 @@ Wallet.prototype._checkSentTx = function(ntxid, cb) { this.blockchain.getTransaction(txid, function(err, tx) { if (err) return cb(false); - cb(ret); + return cb(ret); }); };