Skip to content

Commit

Permalink
Fix validator flag usage in peer contact book (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
viquezclaudio authored Feb 16, 2023
1 parent ea5bc44 commit 9018657
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion network-libp2p/src/discovery/peer_contacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9018657

Please sign in to comment.