From 5d6728f39f75d3da4bb9cbf3623b1e9fe822b59a Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:57:52 +0300 Subject: [PATCH] Filtering all the peers except myself now --- chatBot/includes/client.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chatBot/includes/client.js b/chatBot/includes/client.js index 566f564..46e7d6c 100644 --- a/chatBot/includes/client.js +++ b/chatBot/includes/client.js @@ -22,10 +22,9 @@ class Client extends EventEmitter { this.swarm.on('update', () => { console.log(`Peers count: ${this.swarm.connections.size}`); if(this.swarm.connections.size > 0) { - let arr = []; - [...this.swarm.peers].forEach(peer => arr.push([peer.topics])); - console.log([...this.swarm.peers]) - console.log(arr); + let peers = [...this.swarm.peers].filter(peer => peer.remotePublicKey.toString('hex').startsWith("51be150")) + console.log(peers[0]) + console.log([peers[0].topics]); } }); }