From 7e836f3fdecd531b1572608be05647bbb1e235a6 Mon Sep 17 00:00:00 2001
From: librelois <elois@ifee.fr>
Date: Thu, 30 Nov 2017 00:38:44 +0100
Subject: [PATCH] [fix] #1220

---
 app/modules/ws2p/lib/WS2PCluster.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/modules/ws2p/lib/WS2PCluster.ts b/app/modules/ws2p/lib/WS2PCluster.ts
index 6588f032b..8c36f0cd0 100644
--- a/app/modules/ws2p/lib/WS2PCluster.ts
+++ b/app/modules/ws2p/lib/WS2PCluster.ts
@@ -278,9 +278,12 @@ export class WS2PCluster {
 
   clientsCount() {
     let count = 0
+    let connectedKeys:string[] = []
     for (const ws2pid in this.ws2pClients) {
-      if (this.ws2pClients[ws2pid].connection.pubkey != this.server.conf.pair.pub) {
+      if (this.ws2pClients[ws2pid].connection.pubkey != this.server.conf.pair.pub
+        && connectedKeys.indexOf(this.ws2pClients[ws2pid].connection.pubkey) == -1) {
         count++
+        connectedKeys.push(this.ws2pClients[ws2pid].connection.pubkey)
       }
     }
     return count
-- 
GitLab