Browse Source

fix data parsing

activeAddress
Ivan Socolsky 10 years ago
parent
commit
b45acded82
  1. 2
      lib/blockchainexplorers/insight.js
  2. 4
      lib/server.js

2
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); if (err || res.statusCode !== 200) return cb(err || res);
return cb(null, body ? body.txid : null); return cb(null, body ? body.txid : null);
}); });

4
lib/server.js

@ -584,8 +584,8 @@ WalletService.prototype._getUtxos = function(cb) {
log.error('Could not fetch unspent outputs', err); log.error('Could not fetch unspent outputs', err);
return cb(new ClientError('BLOCKCHAINERROR', 'Could not fetch unspent outputs')); return cb(new ClientError('BLOCKCHAINERROR', 'Could not fetch unspent outputs'));
} }
var utxos = _.map(inutxos, function(i) { var utxos = _.map(inutxos, function(utxo) {
return _.pick(i.toObject(), ['txid', 'vout', 'address', 'scriptPubKey', 'amount', 'satoshis']); return _.pick(utxo, ['txid', 'vout', 'address', 'scriptPubKey', 'amount', 'satoshis']);
}); });
self.getPendingTxs({}, function(err, txps) { self.getPendingTxs({}, function(err, txps) {
if (err) return cb(err); if (err) return cb(err);

Loading…
Cancel
Save