mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #2875 from cmgustavo/feat/scan-all-addresses
Clean last address and scann all addresses
This commit is contained in:
commit
9d575ecb7c
|
@ -481,7 +481,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
self.clientError = function(err) {
|
||||
if (isCordova) {
|
||||
navigator.notification.confirm(
|
||||
|
@ -549,8 +548,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
c.startScan({
|
||||
includeCopayerBranches: true,
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
if (self.walletId == walletId)
|
||||
if (err && self.walletId == walletId) {
|
||||
self.setOngoingProcess('scanning', false);
|
||||
self.handleError(err);
|
||||
$rootScope.$apply();
|
||||
|
@ -624,6 +622,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
|
||||
$rootScope.$on('Local/BWSUpdated', function(event) {
|
||||
profileService.applyConfig();
|
||||
storageService.setCleanAndScanAddresses(function() {});
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/WalletCompleted', function(event) {
|
||||
|
@ -769,6 +768,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.setFocusedWallet();
|
||||
self.updateTxHistory();
|
||||
go.walletHome();
|
||||
storageService.getCleanAndScanAddresses(function(err, val) {
|
||||
if (val) {
|
||||
$log.debug('Clear last address cache and Scan');
|
||||
var wallets = profileService.walletClients;
|
||||
for (var walletId in wallets) {
|
||||
storageService.clearLastAddress(walletId, function(err) {
|
||||
self.startScan(walletId);
|
||||
});
|
||||
}
|
||||
storageService.removeCleanAndScanAddresses(function() {});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/SetTab', function(event, tab, reset) {
|
||||
|
|
|
@ -151,6 +151,18 @@ angular.module('copayApp.services')
|
|||
storage.get('backup-' + walletId, cb);
|
||||
};
|
||||
|
||||
root.setCleanAndScanAddresses = function(cb) {
|
||||
storage.set('CleanAndScanAddresses', Date.now(), cb);
|
||||
};
|
||||
|
||||
root.getCleanAndScanAddresses = function(cb) {
|
||||
storage.get('CleanAndScanAddresses', cb);
|
||||
};
|
||||
|
||||
root.removeCleanAndScanAddresses = function(cb) {
|
||||
storage.remove('CleanAndScanAddresses', cb);
|
||||
};
|
||||
|
||||
root.getConfig = function(cb) {
|
||||
storage.get('config', cb);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue