From faf48d9b1b31a7bc28a5bb6ca1f2bc4c2aae5e69 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Wed, 14 Jan 2015 19:31:31 +0100
Subject: [PATCH] Clear nodes not using the same currency from the peers

---
 src/cutecoin/core/community.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/cutecoin/core/community.py b/src/cutecoin/core/community.py
index 6686aa86..c76e93ae 100644
--- a/src/cutecoin/core/community.py
+++ b/src/cutecoin/core/community.py
@@ -22,7 +22,7 @@ class Community(object):
         A community is a group of nodes using the same currency.
         '''
         self.currency = currency
-        self.peers = peers
+        self.peers = [p for p in peers if p.currency == currency]
         self.requests_cache = {}
         self.last_block = None
 
@@ -30,6 +30,7 @@ class Community(object):
         # we refresh its peers tree
         found_peers = self.peering()
         for p in found_peers:
+            logging.debug(p.currency)
             if p.pubkey not in [peer.pubkey for peer in peers]:
                 self.peers.append(p)
 
-- 
GitLab