From 78f59818568c37c7ea1df646e069c8a35504e64a Mon Sep 17 00:00:00 2001 From: Divma <26765164+divagant-martian@users.noreply.github.com> Date: Mon, 7 Feb 2022 14:00:46 -0500 Subject: [PATCH] protocols/gossipsub: Emit gossip of all non empty topics (#2481) Co-authored-by: Max Inden --- protocols/gossipsub/CHANGELOG.md | 3 +++ protocols/gossipsub/src/behaviour.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/protocols/gossipsub/CHANGELOG.md b/protocols/gossipsub/CHANGELOG.md index c3f67871..36bb23bd 100644 --- a/protocols/gossipsub/CHANGELOG.md +++ b/protocols/gossipsub/CHANGELOG.md @@ -6,7 +6,10 @@ - Move from `open-metrics-client` to `prometheus-client` (see [PR 2442]). +- Emit gossip of all non empty topics (see [PR 2481]). + [PR 2442]: https://github.com/libp2p/rust-libp2p/pull/2442 +[PR 2481]: https://github.com/libp2p/rust-libp2p/pull/2481 # 0.35.0 [2022-01-27] diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index 41f25ed3..489f9169 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -2508,7 +2508,7 @@ where for (topic_hash, peers) in self.mesh.iter().chain(self.fanout.iter()) { let mut message_ids = self.mcache.get_gossip_message_ids(topic_hash); if message_ids.is_empty() { - return; + continue; } // if we are emitting more than GossipSubMaxIHaveLength message_ids, truncate the list