mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Apply PR feedback
This commit is contained in:
@ -265,10 +265,12 @@ class GossipSub(IPubsubRouter):
|
|||||||
async def mesh_heartbeat(self):
|
async def mesh_heartbeat(self):
|
||||||
# Note: the comments here are the exact pseudocode from the spec
|
# Note: the comments here are the exact pseudocode from the spec
|
||||||
for topic in self.mesh:
|
for topic in self.mesh:
|
||||||
|
# Skip if no peers have subscribed to the topic
|
||||||
|
if topic not in self.pubsub.peer_topics:
|
||||||
|
continue
|
||||||
|
|
||||||
num_mesh_peers_in_topic = len(self.mesh[topic])
|
num_mesh_peers_in_topic = len(self.mesh[topic])
|
||||||
if num_mesh_peers_in_topic < self.degree_low:
|
if num_mesh_peers_in_topic < self.degree_low:
|
||||||
if topic in self.pubsub.peer_topics:
|
|
||||||
gossipsub_peers_in_topic = [peer for peer in self.pubsub.peer_topics[topic]
|
gossipsub_peers_in_topic = [peer for peer in self.pubsub.peer_topics[topic]
|
||||||
if peer in self.peers_gossipsub]
|
if peer in self.peers_gossipsub]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user