From b45acded823609fe14a397f4a984e98001d75b63 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 11 Jun 2015 18:50:50 -0300 Subject: [PATCH] fix data parsing --- lib/blockchainexplorers/insight.js | 2 +- lib/server.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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);