We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42c64a2 commit 7e0cddeCopy full SHA for 7e0cdde
beacon_node/lighthouse_network/gossipsub/src/behaviour.rs
@@ -679,9 +679,15 @@ where
679
// Gossipsub peers
680
None => {
681
tracing::debug!(topic=%topic_hash, "Topic not in the mesh");
682
+ // `fanout_peers` is always non-empty if it's `Some`.
683
+ let fanout_peers = self
684
+ .fanout
685
+ .get(&topic_hash)
686
+ .map(|peers| if peers.is_empty() { None } else { Some(peers) })
687
+ .unwrap_or(None);
688
// If we have fanout peers add them to the map.
- if self.fanout.contains_key(&topic_hash) {
- for peer in self.fanout.get(&topic_hash).expect("Topic must exist") {
689
+ if let Some(peers) = fanout_peers {
690
+ for peer in peers {
691
recipient_peers.insert(*peer);
692
}
693
} else {
0 commit comments