Merge pull request #53 from colkito/fix/store-broadcast-new-address

added support for store and broadcast
This commit is contained in:
Gustavo Maximiliano Cortez 2014-04-15 17:00:01 -03:00
commit be3989b0ba
2 changed files with 13 additions and 1 deletions

View File

@ -15,7 +15,7 @@ angular.module('copay.home').controller('HomeController',
}
$scope.newAddr = function() {
var a = $rootScope.wallet.publicKeyRing.generateAddress();
var a = $rootScope.wallet.generateAddress();
$scope.addrs.push({ addrStr: a.toString('hex') });
};

View File

@ -125,6 +125,18 @@ Wallet.prototype.sendPublicKeyRing = function(recipients) {
});
};
Wallet.prototype.generateAddress = function() {
var addr = this.publicKeyRing.generateAddress();
this.store();
this.network.send(null, {
type: 'publicKeyRing',
publicKeyRing: this.publicKeyRing.toObj(),
walletId: this.id
});
return addr;
};
// // HERE? not sure
// Wallet.prototype.cleanPeers = function() {