mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 11:13:34 +00:00
More gossipsub metrics (#6873)
N/A Add metrics that tell us if a duplicate message that we received was from a mesh peer or from a non mesh peer that we requested with iwant message.
This commit is contained in:
@@ -41,6 +41,13 @@ impl GossipPromises {
|
||||
self.promises.contains_key(message)
|
||||
}
|
||||
|
||||
/// Returns true if the message id exists in the promises and contains the given peer.
|
||||
pub(crate) fn contains_peer(&self, message: &MessageId, peer: &PeerId) -> bool {
|
||||
self.promises
|
||||
.get(message)
|
||||
.is_some_and(|peers| peers.contains_key(peer))
|
||||
}
|
||||
|
||||
///Get the peers we sent IWANT the input message id.
|
||||
pub(crate) fn peers_for_message(&self, message_id: &MessageId) -> Vec<PeerId> {
|
||||
self.promises
|
||||
|
||||
Reference in New Issue
Block a user