Merge pull request #51 from cmgustavo/bug/01-generateaddress

Fixed generateAddress in front-end...
This commit is contained in:
Mario Colque 2014-04-15 15:05:34 -03:00
commit 072e55665d
2 changed files with 7 additions and 9 deletions

View File

@ -6,14 +6,13 @@ angular.module('copay.home').controller('HomeController',
$scope.oneAtATime = true; $scope.oneAtATime = true;
if (!$rootScope.wallet.id) { if (!$rootScope.wallet || !$rootScope.wallet.id) {
$location.path('signin'); $location.path('signin');
} }
else {
$scope.addrs = $rootScope.wallet.publicKeyRing.getAddresses();
$scope.selectedAddr = $scope.addrs[0];
$scope.addrs = $rootScope.wallet.publicKeyRing.getAddresses(); }
$scope.selectedAddr = $scope.addrs[0];
$scope.newAddr = function() { $scope.newAddr = function() {
var a = $rootScope.wallet.publicKeyRing.generateAddress(); var a = $rootScope.wallet.publicKeyRing.generateAddress();

View File

@ -29,13 +29,12 @@ Wallet.prototype._startInterface = function(config) {
this.blockchain = new Blockchain(config.blockchain); this.blockchain = new Blockchain(config.blockchain);
this.networkName = config.networkName; this.networkName = config.networkName;
this.requiredCopayers = config.requiredCopayers; this.requiredCopayers = config.wallet.requiredCopayers;
this.totalCopayers = config.totalCopayers; this.totalCopayers = config.wallet.totalCopayers;
}; };
Wallet.prototype.create = function(opts) { Wallet.prototype.create = function(opts) {
this.id = opts.id || Wallet.getRandomId(); this.id = opts.id || Wallet.getRandomId();
this.log('### CREATING NEW WALLET.' + (opts.id ? ' USING ID: ' + opts.id : ' NEW ID')); this.log('### CREATING NEW WALLET.' + (opts.id ? ' USING ID: ' + opts.id : ' NEW ID'));