diff --git a/lib/blockchainexplorer.js b/lib/blockchainexplorer.js index ae125e2..6005fc0 100644 --- a/lib/blockchainexplorer.js +++ b/lib/blockchainexplorer.js @@ -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); }); };