handles incorrect Address derivation (#4230)

This commit is contained in:
Matias Alejo Garcia 2016-05-20 10:02:44 -03:00
parent 7cc3c5eb4f
commit 335c3f00af
3 changed files with 18 additions and 3 deletions

View File

@ -115,6 +115,15 @@
</div>
</div> <!-- oh -->
<div class="oh pr m20t" ng-show="index.incorrectDerivation">
<div class="text-center text-warning">
<i class="fi-alert"></i>
<span translate>
WARNING: Key derivation is not working on this device/wallet. Actions cannot be performed on this wallet.
</span>
</div>
</div>
<div class="oh pr m20t" ng-show="index.notAuthorized && ! index.anyOnGoingProcess">
<div class="text-center text-warning">

View File

@ -136,6 +136,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.isPrivKeyEncrypted = fc.isPrivKeyEncrypted();
self.externalSource = fc.getPrivKeyExternalSourceName();
self.account = fc.credentials.account;
self.incorrectDerivation = fc.incorrectDerivation;
if (self.externalSource == 'trezor')
self.account++;

View File

@ -75,9 +75,14 @@ angular.module('copayApp.services')
var client = bwcService.getClient(JSON.stringify(credentials));
root.walletClients[credentials.walletId] = client;
if (client.incorrectDerivation) {
storageService.clearLastAddress(credentials.walletId,function() {});
}
client.removeAllListeners();
client.on('report', function(n) {
$log.info('BWC Report:'+ n);
$log.info('BWC Report:' + n);
});
client.on('notification', function(n) {
@ -319,8 +324,8 @@ angular.module('copayApp.services')
// check if exist
if (lodash.find(root.profile.credentials, {
'walletId': walletData.walletId
})) {
'walletId': walletData.walletId
})) {
return cb(gettext('Cannot join the same wallet more that once'));
}
} catch (ex) {