|
|
@ -47,8 +47,8 @@ function getTransactionsInsight(url, addresses, from, to, cb) { |
|
|
|
}, function(err, res, txs) { |
|
|
|
if (err || res.statusCode != 200) return cb(err || res); |
|
|
|
// NOTE: Whenever Insight breaks communication with bitcoind, it returns invalid data but no error code.
|
|
|
|
if (!_.isArray(txs) || _.compact(txs).length == 0) return cb(new Error('Could not retrieve transactions from blockchain')); |
|
|
|
|
|
|
|
if (!_.isArray(txs) || (txs.length != _.compact(txs).length)) return cb(new Error('Could not retrieve transactions from blockchain')); |
|
|
|
|
|
|
|
return cb(null, txs); |
|
|
|
}); |
|
|
|
}; |
|
|
|