peer checking againt by key ring

This commit is contained in:
Matias Alejo Garcia 2014-04-24 23:13:55 -03:00
commit e88dc7afb3
9 changed files with 199 additions and 138 deletions

View file

@ -149,10 +149,16 @@ WalletFactory.prototype.joinCreateSession = function(copayerId, cb) {
//Create our PrivateK
var privateKey = new PrivateKey({ networkName: this.networkName });
this.log('\t### PrivateKey Initialized');
self.network.setCopayerId(privateKey.getId());
self.network.setSigningKey(privateKey.getSigningKey());
self.network.start({}, function() {
var opts = {
copayerId: privateKey.getId(),
signingKeyHex: privateKey.getSigningKey(),
};
self.network.cleanUp();
self.network.start(opts, function() {
self.network.connectTo(copayerId);
self.network.on('onlyYou', function(sender, data) {
return cb();
});
self.network.on('data', function(sender, data) {
if (data.type ==='walletId') {
data.opts.privateKey = privateKey;