check topic exist in `pubsub.peer_topics`
This commit is contained in:
NIC619 2019-07-19 19:40:26 +08:00
parent 2c1c8dc8cf
commit 41141c028b
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17

View File

@ -267,6 +267,7 @@ class GossipSub(IPubsubRouter):
num_mesh_peers_in_topic = len(self.mesh[topic])
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]
if peer in self.peers_gossipsub]