added support for store and broadcast

This commit is contained in:
Mario Colque 2014-04-15 16:50:16 -03:00
parent b54832567b
commit 139628e066
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() {