fix skip Validation. Replaces scanning with updating

This commit is contained in:
Matias Alejo Garcia 2016-06-14 14:05:25 -03:00
commit 57aecf7e1b
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
2 changed files with 11 additions and 9 deletions

View file

@ -286,7 +286,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
} else {
self.isSingleAddress = !!ret.wallet.singleAddress;
if (!opts.quiet)
ongoingProcess.set('scanning', ret.wallet.scanStatus == 'running');
self.updating = ret.wallet.scanStatus == 'running';
}
return cb(err, ret);
});
@ -1015,13 +1015,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (!c.isComplete()) return;
if (self.walletId == walletId)
ongoingProcess.set('scanning', true);
self.updating = true;
c.startScan({
includeCopayerBranches: true,
}, function(err) {
if (err && self.walletId == walletId) {
ongoingProcess.set('scanning', false);
self.updating = false;
self.handleError(err);
$rootScope.$apply();
}

View file

@ -122,12 +122,13 @@ angular.module('copayApp.services')
$timeout(function() {
$log.debug('ValidatingWallet: ' + walletId + ' device validation:' + skipDeviceValidation);
$log.debug('ValidatingWallet: ' + walletId + ' skip Device:' + skipDeviceValidation);
$rootScope.$emit('Local/ValidatingWallet', walletId);
client.validateKeyDerivation({
skipDeviceValidation: skipDeviceValidation,
}, function(err, isOK) {
$log.debug('ValidatingWallet End: ' + walletId + ' isOK:' + isOK);
$rootScope.$emit('Local/ValidatingWalletEnded', walletId, isOK);
if (isOK) {
@ -137,7 +138,7 @@ angular.module('copayApp.services')
storageService.clearLastAddress(walletId, function() {});
}
});
}, 10);
}, 3000);
};
// Used when reading wallets from the profile
@ -159,7 +160,6 @@ angular.module('copayApp.services')
});
var skipKeyValidation = root.profile.isChecked(platformInfo.ua, credentials.walletId);
if (!skipKeyValidation)
root.runValidation(client);
@ -477,6 +477,11 @@ angular.module('copayApp.services')
if (!root.profile.addWallet(JSON.parse(client.export())))
return cb(gettext('Wallet already in Copay'));
var skipKeyValidation = root.profile.isChecked(platformInfo.ua, walletId);
if (!skipKeyValidation)
root.runValidation(client);
root.bindWalletClient(client);
$rootScope.$emit('Local/WalletListUpdated', client);
@ -557,9 +562,6 @@ angular.module('copayApp.services')
var addressBook = str.addressBook || {};
var historyCache = str.historyCache ||  [];
if (!walletClient.incorrectDerivation)
root.profile.setChecked(platformInfo.ua, walletClient.credentials.walletId);
root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl,
isImport: true