Remove unneccessary check in gossip heartbeat
This commit is contained in:
parent
920cf646ef
commit
ab1500c708
|
@ -396,12 +396,11 @@ class GossipSub(IPubsubRouter):
|
|||
if topic in self.pubsub.peer_topics:
|
||||
# Select D peers from peers.gossipsub[topic]
|
||||
peers_to_emit_ihave_to = self._get_in_topic_gossipsub_peers_from_minus(
|
||||
topic, self.degree, []
|
||||
topic, self.degree, self.mesh[topic]
|
||||
)
|
||||
|
||||
for peer in peers_to_emit_ihave_to:
|
||||
if peer not in self.mesh[topic]:
|
||||
msg_id_strs = [str(msg_id) for msg_id in msg_ids]
|
||||
for peer in peers_to_emit_ihave_to:
|
||||
await self.emit_ihave(topic, msg_id_strs, peer)
|
||||
|
||||
# TODO: Refactor and Dedup. This section is the roughly the same as the above.
|
||||
|
@ -414,11 +413,10 @@ class GossipSub(IPubsubRouter):
|
|||
if topic in self.pubsub.peer_topics:
|
||||
# Select D peers from peers.gossipsub[topic]
|
||||
peers_to_emit_ihave_to = self._get_in_topic_gossipsub_peers_from_minus(
|
||||
topic, self.degree, []
|
||||
topic, self.degree, self.fanout[topic]
|
||||
)
|
||||
for peer in peers_to_emit_ihave_to:
|
||||
if peer not in self.fanout[topic]:
|
||||
msg_id_strs = [str(msg) for msg in msg_ids]
|
||||
for peer in peers_to_emit_ihave_to:
|
||||
await self.emit_ihave(topic, msg_id_strs, peer)
|
||||
|
||||
self.mcache.shift()
|
||||
|
|
Loading…
Reference in New Issue
Block a user