handle error from blockexplores
This commit is contained in:
parent
f51e7bd0e0
commit
213451f0d6
|
@ -458,7 +458,7 @@ WalletService.prototype._getUtxos = function(cb) {
|
|||
|
||||
var bc = self._getBlockchainExplorer('insight', networkName);
|
||||
bc.getUnspentUtxos(addressStrs, function(err, inutxos) {
|
||||
if (err) return cb(err);
|
||||
if (err) return cb(new Error('Could not fetch unspend outputs:' + err));
|
||||
var utxos = _.map(inutxos, function(i) {
|
||||
return _.pick(i.toObject(), ['txid', 'vout', 'address', 'scriptPubKey', 'amount', 'satoshis']);
|
||||
});
|
||||
|
@ -1121,7 +1121,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) {
|
|||
},
|
||||
function(next) {
|
||||
bc.getTransactions(addressStrs, null, null, function(err, txs) {
|
||||
if (err) return next(err);
|
||||
if (err) return next('Could not fetch transactions: ' + err);
|
||||
|
||||
next(null, self._normalizeTxHistory(txs));
|
||||
});
|
||||
|
@ -1179,7 +1179,7 @@ WalletService.prototype.scan = function(opts, cb) {
|
|||
if (err) return next(err);
|
||||
allAddresses.push(addresses);
|
||||
checkActivity(_.pluck(addresses, 'address'), function(err, thereIsActivity) {
|
||||
if (err) return next(err);
|
||||
if (err) return next('Could not fetch TX activity:' + err);
|
||||
activity = thereIsActivity;
|
||||
next();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue