peerId hashing WIP2
This commit is contained in:
parent
88d758a793
commit
c1881d5fbb
5 changed files with 162 additions and 89 deletions
|
|
@ -139,21 +139,21 @@ WalletFactory.prototype.remove = function(walletId) {
|
|||
};
|
||||
|
||||
|
||||
WalletFactory.prototype.joinCreateSession = function(peerId, cb) {
|
||||
WalletFactory.prototype.joinCreateSession = function(copayerId, cb) {
|
||||
var self = this;
|
||||
|
||||
//Create our PrivateK
|
||||
var privateKey = new PrivateKey({ networkName: this.networkName });
|
||||
this.log('\t### PrivateKey Initialized');
|
||||
self.network.setPeerId(privateKey.getId());
|
||||
self.network.setCopayerId(privateKey.getId());
|
||||
|
||||
self.network.start(function() {
|
||||
self.network.connectTo(peerId);
|
||||
self.network.connectTo(copayerId);
|
||||
self.network.on('data', function(sender, data) {
|
||||
if (data.type ==='walletId') {
|
||||
data.opts.privateKey = privateKey;
|
||||
var w = self.open(data.walletId, data.opts);
|
||||
w.firstPeerId = peerId;
|
||||
w.firstCopayerId = copayerId;
|
||||
return cb(w);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue