Skip to content

Commit

Permalink
print peers every interval [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Aug 29, 2024
1 parent d950e28 commit 13af03e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/p2p/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,13 @@ impl P2PClient {
let num_peers = gossipsub.all_peers().count();
let num_mesh_peers = gossipsub.all_mesh_peers().count();

// print peers if the count has changed
// print peer counts
log::info!("Peer Count (mesh/all): {} / {}", num_mesh_peers, num_peers);

// print peers themselves if the count has changed
if num_peers != self.peer_count.0 || num_mesh_peers != self.peer_count.1 {
self.peer_count = (num_peers, num_mesh_peers);
log::info!("Peer Count (mesh/all): {} / {}", num_mesh_peers, num_peers);

log::debug!(
"All Peers:\n{}",
gossipsub
Expand Down

0 comments on commit 13af03e

Please sign in to comment.