From 9018657075f21bb2cb5e3abfa26bb90e6cd9981a Mon Sep 17 00:00:00 2001 From: viquezclaudio <31874948+viquezclaudio@users.noreply.github.com> Date: Thu, 16 Feb 2023 16:34:33 -0600 Subject: [PATCH] Fix validator flag usage in peer contact book (#1345) --- network-libp2p/src/discovery/peer_contacts.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network-libp2p/src/discovery/peer_contacts.rs b/network-libp2p/src/discovery/peer_contacts.rs index 862fb196c3..a6898fa086 100644 --- a/network-libp2p/src/discovery/peer_contacts.rs +++ b/network-libp2p/src/discovery/peer_contacts.rs @@ -340,7 +340,10 @@ impl PeerContactBook { pub fn insert_filtered(&mut self, contact: SignedPeerContact, services_filter: Services) { let info = PeerContactInfo::from(contact); - if services_filter.contains(Services::VALIDATOR) + if self + .own_peer_contact + .services() + .contains(Services::VALIDATOR) && info.services().contains(Services::VALIDATOR) { // If I'm configured as a validator, and the peer is also a validator, then that peer is interesting to me,