Skip to content

Commit

Permalink
chore: remove some useless logs
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Jun 10, 2024
1 parent ba57a35 commit a338f01
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sn_networking/src/event/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,16 @@ impl SwarmDriver {
if port == our_port {
info!(%address, "external address: new candidate has the same configured port, adding it.");
self.swarm.add_external_address(address);

if tracing::level_enabled!(tracing::Level::TRACE) {
let all_external_addresses =
self.swarm.external_addresses().collect_vec();
let all_listeners = self.swarm.listeners().collect_vec();
trace!("All our listeners: {all_listeners:?}");
trace!(
"All our external addresses: {all_external_addresses:?}"
);
}
} else {
info!(%address, %our_port, "external address: new candidate has a different port, not adding it.");
}
Expand All @@ -577,10 +587,6 @@ impl SwarmDriver {
trace!("external address: listen port not set. This has to be set if you're running a node");
}
}
let all_external_addresses = self.swarm.external_addresses().collect_vec();
let all_listeners = self.swarm.listeners().collect_vec();
trace!("All our listeners: {all_listeners:?}");
trace!("All our external addresses: {all_external_addresses:?}");
}
SwarmEvent::ExternalAddrConfirmed { address } => {
event_string = "ExternalAddrConfirmed";
Expand Down Expand Up @@ -677,7 +683,6 @@ impl SwarmDriver {
shall_removed.len(),
self.live_connected_peers.len()
);
trace!(?self.relay_manager);

for (connection_id, peer_id) in shall_removed {
let _ = self.live_connected_peers.remove(&connection_id);
Expand Down
8 changes: 8 additions & 0 deletions sn_networking/src/relay_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use crate::driver::{BadNodes, NodeBehaviour};
use itertools::Itertools;
use libp2p::{
core::transport::ListenerId, multiaddr::Protocol, Multiaddr, PeerId, StreamProtocol, Swarm,
};
Expand Down Expand Up @@ -205,6 +206,13 @@ impl RelayManager {
peer_id: &PeerId,
swarm: &mut Swarm<NodeBehaviour>,
) {
if tracing::level_enabled!(tracing::Level::TRACE) {
let all_external_addresses = swarm.external_addresses().collect_vec();
let all_listeners = swarm.listeners().collect_vec();
trace!("All our listeners: {all_listeners:?}");
trace!("All our external addresses: {all_external_addresses:?}");
}

match self.waiting_for_reservation.remove(peer_id) {
Some(addr) => {
info!("Successfully made reservation with {peer_id:?} on {addr:?}. Adding the addr to external address.");
Expand Down

0 comments on commit a338f01

Please sign in to comment.