diff --git a/js/controllers/backup.js b/js/controllers/backup.js index 4c9311e02..359354691 100644 --- a/js/controllers/backup.js +++ b/js/controllers/backup.js @@ -1,14 +1,15 @@ 'use strict'; angular.module('copayApp.controllers').controller('BackupController', - function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils) { + function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils, notification) { var s = ($location.search()).advanced; if (s) { var w = $rootScope.wallet; - $scope.priv = w.privateKey.toObj().extendedPrivateKeyString; + $scope.advanced = 1; + $scope.priv = w.privateKey.toObj().extendedPrivateKeyString; } - + $scope.downloadBackup = function() { var w = $rootScope.wallet; backupService.download(w); @@ -21,4 +22,20 @@ angular.module('copayApp.controllers').controller('BackupController', controllerUtils.logout(); }); }; + + $scope.updateIndexes = function() { + var w = $rootScope.wallet; + + notification.info('Scaning for transactions','Using derived addresses from your wallet'); + w.updateIndexes(function(err) { + notification.info('Scan Ended', 'Updating balance'); + if (err) { + notification.error('Error', 'Error updating indexes: ' + err); + } + controllerUtils.updateAddressList(); + controllerUtils.updateBalance(function(){ + notification.info('Finished', 'The balance is updated using the derived addresses'); + }); + }); + }; }); diff --git a/views/backup.html b/views/backup.html index d747bbb9e..25d6ae28a 100644 --- a/views/backup.html +++ b/views/backup.html @@ -18,9 +18,28 @@
-

Master Private Key

-

- {{priv}} +

Master Private Key

+

Your master private key contains the information to sign any transaction on this wallet. Handle with care. +

+ + Show + Hide + +
+ +

+
+

Scan Wallet Addresses

+

This will scan the blockchain looking for addresses derived from your wallet, in case you have funds in addresses not yet generated (e.g.: you restored an old backup). +

+ + Scan + +
+
+