diff --git a/lib/blockchainexplorers/insight.js b/lib/blockchainexplorers/insight.js index 6c1113c..f11e901 100644 --- a/lib/blockchainexplorers/insight.js +++ b/lib/blockchainexplorers/insight.js @@ -52,7 +52,7 @@ Insight.prototype.broadcast = function(rawTx, cb) { }, }; - request(args, function(err, res, unspent) { + request(args, function(err, res, body) { if (err || res.statusCode !== 200) return cb(err || res); return cb(null, body ? body.txid : null); }); diff --git a/lib/server.js b/lib/server.js index a0a3a0d..fe4a220 100644 --- a/lib/server.js +++ b/lib/server.js @@ -584,8 +584,8 @@ WalletService.prototype._getUtxos = function(cb) { log.error('Could not fetch unspent outputs', err); return cb(new ClientError('BLOCKCHAINERROR', 'Could not fetch unspent outputs')); } - var utxos = _.map(inutxos, function(i) { - return _.pick(i.toObject(), ['txid', 'vout', 'address', 'scriptPubKey', 'amount', 'satoshis']); + var utxos = _.map(inutxos, function(utxo) { + return _.pick(utxo, ['txid', 'vout', 'address', 'scriptPubKey', 'amount', 'satoshis']); }); self.getPendingTxs({}, function(err, txps) { if (err) return cb(err);