From d0d35bcddd992aec479b38495b803b18cf2a3fb7 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sun, 7 Apr 2019 13:43:45 +0200
Subject: [PATCH] [mod] #1356: Remove non-used code getting membership status.
 Typos in comments

---
 app/modules/prover/lib/blockGenerator.ts | 4 ++--
 app/modules/ws2p/lib/WS2PCluster.ts      | 3 ---
 app/service/BlockchainService.ts         | 4 ----
 server.ts                                | 4 ----
 4 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/app/modules/prover/lib/blockGenerator.ts b/app/modules/prover/lib/blockGenerator.ts
index 6cd68b0cb..f22103495 100644
--- a/app/modules/prover/lib/blockGenerator.ts
+++ b/app/modules/prover/lib/blockGenerator.ts
@@ -335,7 +335,7 @@ export class BlockGenerator {
     for (const newcomer of theNewcomers) {
       // New array of certifiers
       newCerts[newcomer] = newCerts[newcomer] || [];
-      // Check wether each certification of the block is from valid newcomer/member
+      // Check whether each certification of the block is from valid newcomer/member
       for (const cert of certsByKey[newcomer]) {
         const isAlreadyCertifying = certifiers.indexOf(cert.from) !== -1;
         if (!(isAlreadyCertifying && forBlock > 0)) {
@@ -390,7 +390,7 @@ export class BlockGenerator {
         // Look for certifications from initial joiners
         const certs = await this.dal.certsNotLinkedToTarget(idHash);
         foundCerts = Underscore.filter(certs, (cert:any) => {
-          // Add 'joiners && ': special case when block#0 not written ANd not joiner yet (avoid undefined error)
+          // Add 'joiners && ': special case when block#0 not written and not joiner yet (avoid undefined error)
           return !!(joiners && ~joiners.indexOf(cert.from))
         });
       } else {
diff --git a/app/modules/ws2p/lib/WS2PCluster.ts b/app/modules/ws2p/lib/WS2PCluster.ts
index 4456010c4..0ffe1fb9b 100644
--- a/app/modules/ws2p/lib/WS2PCluster.ts
+++ b/app/modules/ws2p/lib/WS2PCluster.ts
@@ -822,9 +822,6 @@ export class WS2PCluster {
       return false
     }
 
-    // Is member key ?
-    const isMemberPeer = await this.server.dal.isMember(pub)
-
     // Do we have room?
     if (getConcurrentConnexionsCount() < maxConcurrentConnexionsSize) {
       // Yes: just connect to it
diff --git a/app/service/BlockchainService.ts b/app/service/BlockchainService.ts
index a6f96216c..ccd46bd06 100644
--- a/app/service/BlockchainService.ts
+++ b/app/service/BlockchainService.ts
@@ -433,10 +433,6 @@ export class BlockchainService extends FIFOService {
     })
   }
 
-  isMember() {
-    return this.dal.isMember(this.selfPubkey)
-  }
-
   // TODO: look in archives too
   getCountOfSelfMadePoW() {
     return this.dal.getCountOfPoW(this.selfPubkey)
diff --git a/server.ts b/server.ts
index dc8cd270f..598cdf760 100644
--- a/server.ts
+++ b/server.ts
@@ -367,10 +367,6 @@ export class Server extends stream.Duplex implements HookableServer {
     return this.BlockchainService.getCountOfSelfMadePoW()
   }
   
-  isServerMember() {
-    return this.BlockchainService.isMember()
-  }
-
   checkConfig(): Promise<any> {
     if (!this.conf.pair) {
       throw new Error('No keypair was given.');
-- 
GitLab