Browse Source

fix insight response parsing with from/to are used

activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
80df5e2e31
  1. 4
      lib/blockchainexplorers/insight.js

4
lib/blockchainexplorers/insight.js

@ -87,6 +87,10 @@ Insight.prototype.getTransactions = function(addresses, from, to, cb) {
request(args, function(err, res, txs) {
if (err || res.statusCode != 200) return cb(err || res);
if (_.isObject(txs) && txs.items)
txs = txs.items;
// NOTE: Whenever Insight breaks communication with bitcoind, it returns invalid data but no error code.
if (!_.isArray(txs) || (txs.length != _.compact(txs).length)) return cb(new Error('Could not retrieve transactions from blockchain. Request was:' + JSON.stringify(args)));

Loading…
Cancel
Save