def get_all_peerids(self):
if not self.introducer_client:
return []
- return self.introducer_client.connections.iterkeys()
+ return self.introducer_client.get_all_peerids()
def get_permuted_peers(self, key):
"""
@return: list of (permuted-peerid, peerid, connection,)
"""
results = []
- for peerid, connection in self.introducer_client.connections.iteritems():
+ for peerid, connection in self.introducer_client.get_all_peers():
assert isinstance(peerid, str)
permuted = bytes_to_long(sha.new(key + peerid).digest())
results.append((permuted, peerid, connection))
def connected_to_introducer(self):
return self._connected
+
+ def get_all_peerids(self):
+ return self.connections.iterkeys()
+
+ def get_all_peers(self):
+ return self.connections.iteritems()