mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
A little bit clean up
This commit is contained in:
@ -208,13 +208,11 @@ class GossipSub(IPubsubRouter):
|
||||
# in the fanout for a topic (or the topic is not in the fanout).
|
||||
# Selects the remaining number of peers (D-x) from peers.gossipsub[topic].
|
||||
if topic in self.pubsub.peer_topics:
|
||||
gossipsub_peers_in_topic = [peer for peer in self.pubsub.peer_topics[topic]
|
||||
if peer in self.peers_gossipsub]
|
||||
selected_peers = \
|
||||
GossipSub.select_from_minus(self.degree - fanout_size,
|
||||
gossipsub_peers_in_topic,
|
||||
fanout_peers)
|
||||
|
||||
selected_peers = self._get_peers_from_minus(
|
||||
topic,
|
||||
self.degree - fanout_size,
|
||||
fanout_peers,
|
||||
)
|
||||
# Combine fanout peers with selected peers
|
||||
fanout_peers += selected_peers
|
||||
|
||||
@ -295,7 +293,7 @@ class GossipSub(IPubsubRouter):
|
||||
selected_peers = GossipSub.select_from_minus(
|
||||
self.degree - num_mesh_peers_in_topic,
|
||||
gossipsub_peers_in_topic,
|
||||
self.mesh[topic]
|
||||
self.mesh[topic],
|
||||
)
|
||||
|
||||
fanout_peers_not_in_mesh = [
|
||||
|
||||
Reference in New Issue
Block a user