Skip to content

Commit

Permalink
increment peer per topic count on graft messages (#5212)
Browse files Browse the repository at this point in the history
* increment peer per topic count on graft messages
  • Loading branch information
jxs authored Feb 8, 2024
1 parent 8530427 commit 675a231
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion beacon_node/lighthouse_network/src/gossipsub/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,11 @@ where
tracing::error!(peer_id = %peer_id, "Peer non-existent when handling graft");
return;
};
connected_peer.topics.insert(topic.clone());
if connected_peer.topics.insert(topic.clone()) {
if let Some(m) = self.metrics.as_mut() {
m.inc_topic_peers(topic);
}
}
}

// we don't GRAFT to/from explicit peers; complain loudly if this happens
Expand Down

0 comments on commit 675a231

Please sign in to comment.