Skip to content

Commit e6ae325

Browse files
committed
fix: count always-allowed nodes by pubkey, not port (which can omit inbound neighbors)
1 parent dd2a8a2 commit e6ae325

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stackslib/src/net/p2p.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,9 @@ impl PeerNetwork {
989989
let num_allowed_peers = allowed_peers.len();
990990
let mut count = 0;
991991
for allowed in allowed_peers {
992-
if self.events.contains_key(&allowed.addr) {
993-
count += 1;
994-
}
992+
let pubkh = Hash160::from_node_public_key(&allowed.public_key);
993+
let events = self.get_pubkey_events(&pubkh);
994+
count += events.len() as u64;
995995
}
996996
Ok((count, num_allowed_peers as u64))
997997
}

0 commit comments

Comments
 (0)