From 524b4d9601fd32f1122a7899998f463b5c004ee2 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Wed, 9 May 2018 20:47:09 +0300 Subject: [PATCH] feat(p2p): peerId protocol handshake --- src/background/p2p.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/background/p2p.js b/src/background/p2p.js index 4ac5499..b5eda26 100644 --- a/src/background/p2p.js +++ b/src/background/p2p.js @@ -68,6 +68,7 @@ class p2p { callback({ protocol: 'rats', version: this.version, + peerId: this.peerId, info: this.info, peers: shuffle(this.peersList()).slice(0, 4).map(peer => ({address: peer.address, port: peer.port})) }) @@ -241,6 +242,7 @@ class p2p { protocol: 'rats', port: config.spiderPort, version: this.version, + peerId: this.peerId, info: this.info, peers: shuffle(this.peersList()).slice(0, 4).map(peer => ({address: peer.address, port: peer.port})).concat(this.externalPeers) // also add external peers }, (data) => { @@ -263,6 +265,7 @@ class p2p { this.size++; //extra info address.version = data.version + address.peerId = data.peerId address.info = data.info this.send('peer', { size: this.size,