fixed failing demo

Co-authored-by: Khwahish Patel <khwahish.p1@ahduni.edu.in>
This commit is contained in:
Mystical
2025-06-20 13:57:02 +05:30
parent 303bf3060a
commit 24e73207d2
3 changed files with 26 additions and 4 deletions

View File

@ -354,10 +354,11 @@ class GossipSub(IPubsubRouter, Service):
topic_in_fanout: bool = topic in self.fanout
fanout_peers: set[ID] = set()
for peer in self.fanout[topic]:
if self._check_back_off(peer, topic):
continue
fanout_peers.add(peer)
if topic_in_fanout:
for peer in self.fanout[topic]:
if self._check_back_off(peer, topic):
continue
fanout_peers.add(peer)
fanout_size = len(fanout_peers)
if not topic_in_fanout or (topic_in_fanout and fanout_size < self.degree):