fix for 0 records retrieved

This commit is contained in:
Ivan Socolsky 2015-04-06 17:41:04 -03:00
parent 7243fcd32c
commit 3e279e74f2
1 changed files with 2 additions and 2 deletions

View File

@ -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);
});
};