mirror of https://github.com/BTCPrivate/copay.git
add scaning options too more
This commit is contained in:
parent
4b3cbfcfb0
commit
e760dae2bd
|
@ -1,14 +1,15 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('BackupController',
|
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;
|
var s = ($location.search()).advanced;
|
||||||
if (s) {
|
if (s) {
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
$scope.priv = w.privateKey.toObj().extendedPrivateKeyString;
|
$scope.advanced = 1;
|
||||||
|
$scope.priv = w.privateKey.toObj().extendedPrivateKeyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$scope.downloadBackup = function() {
|
$scope.downloadBackup = function() {
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
backupService.download(w);
|
backupService.download(w);
|
||||||
|
@ -21,4 +22,20 @@ angular.module('copayApp.controllers').controller('BackupController',
|
||||||
controllerUtils.logout();
|
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');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,9 +18,28 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="oh large-12 columns panel" ng-if="priv">
|
<div class="oh large-12 columns panel" ng-if="priv">
|
||||||
<h3><i class="fi-minus-circle m10r"></i> Master Private Key </h3>
|
<h3><i class="fi-minus-circle m10r"></i> Master Private Key </h3>
|
||||||
<p class="large-8 columns text-gray">
|
<p class="large-8 columns text-gray"> Your master private key contains the information to sign <b>any</b> transaction on this wallet. Handle with care.
|
||||||
{{priv}}
|
<div class="large-4 columns">
|
||||||
|
<a class="button expand" ng-click="showPriv=!showPriv">
|
||||||
|
<span ng-hide="showPriv">Show</span>
|
||||||
|
<span ng-hide="!showPriv">Hide</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<textarea class="text-gray" ng-hide="!showPriv">
|
||||||
|
{{priv}}
|
||||||
|
</textarea>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="oh large-12 columns panel" ng-if="advanced">
|
||||||
|
<h3><i class="fi-minus-circle m10r"></i> Scan Wallet Addresses </h3>
|
||||||
|
<p class="large-8 columns text-gray"> 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).
|
||||||
|
<div class="large-4 columns">
|
||||||
|
<a class="button expand" ng-click="updateIndexes()">
|
||||||
|
Scan
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue