mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Fix:
in mesh heartbeat, select from gossipsub peers subscribed to the topic
This commit is contained in:
@ -267,10 +267,12 @@ class GossipSub(IPubsubRouter):
|
||||
|
||||
num_mesh_peers_in_topic = len(self.mesh[topic])
|
||||
if num_mesh_peers_in_topic < self.degree_low:
|
||||
gossipsub_peers_in_topic = [peer for peer in self.pubsub.peer_topics[topic]
|
||||
if peer in self.peers_gossipsub]
|
||||
|
||||
# Select D - |mesh[topic]| peers from peers.gossipsub[topic] - mesh[topic]
|
||||
selected_peers = GossipSub.select_from_minus(self.degree - num_mesh_peers_in_topic,
|
||||
self.peers_gossipsub, self.mesh[topic])
|
||||
gossipsub_peers_in_topic, self.mesh[topic])
|
||||
|
||||
for peer in selected_peers:
|
||||
# Add peer to mesh[topic]
|
||||
|
||||
Reference in New Issue
Block a user