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); }); };