mirror of https://github.com/BTCPrivate/copay.git
add history download retry if err
This commit is contained in:
parent
061e222184
commit
884ff75f5a
|
@ -403,7 +403,16 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
|||
|
||||
function getNewTxs(newTxs, skip, cb) {
|
||||
getTxsFromServer(wallet, skip, endingTxid, requestLimit, function(err, res, shouldContinue) {
|
||||
if (err) return cb(err);
|
||||
if (err) {
|
||||
$log.warn('BWS Error:' + err); //TODO
|
||||
if (err instanceof errors.CONNECTION_ERROR || (err.message && err.message.match(/5../))) {
|
||||
log.info('Retrying history download in 5 secs...');
|
||||
return $timeout(function() {
|
||||
return getNewTxs(newTxs, skip, cb);
|
||||
}, 5000);
|
||||
};
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
newTxs = newTxs.concat(processNewTxs(wallet, lodash.compact(res)));
|
||||
|
||||
|
|
Loading…
Reference in New Issue