Fix history
This commit is contained in:
parent
c2484b3b7a
commit
7243fcd32c
|
@ -16,7 +16,7 @@ function BlockChainExplorer(opts) {
|
|||
var network = opts.network || 'livenet';
|
||||
var dfltUrl = network == 'livenet' ? 'https://insight.bitpay.com:443' :
|
||||
'https://test-insight.bitpay.com:443';
|
||||
var url = opts.url || 'http://localhost:3003';
|
||||
var url = opts.url || dfltUrl;
|
||||
|
||||
var url;
|
||||
switch (provider) {
|
||||
|
@ -46,6 +46,7 @@ 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'));
|
||||
|
||||
return cb(null, txs);
|
||||
|
|
Loading…
Reference in New Issue