mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: improve incoming connection traces (#2393)
This commit is contained in:
@ -658,7 +658,7 @@ where
|
||||
?total_active,
|
||||
"Session established"
|
||||
);
|
||||
debug!(target: "net", peer_enode=%NodeRecord::new(remote_addr, peer_id), "Established peer enode");
|
||||
debug!(target: "net", kind=%direction, peer_enode=%NodeRecord::new(remote_addr, peer_id), "Established peer enode");
|
||||
|
||||
if direction.is_incoming() {
|
||||
this.swarm
|
||||
|
||||
@ -693,6 +693,15 @@ impl Direction {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Direction {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Direction::Incoming => write!(f, "incoming"),
|
||||
Direction::Outgoing(_) => write!(f, "outgoing"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The error thrown when the max configured limit has been reached and no more connections are
|
||||
/// accepted.
|
||||
#[derive(Debug, Clone, thiserror::Error)]
|
||||
|
||||
@ -221,6 +221,7 @@ where
|
||||
|
||||
match self.sessions.on_incoming(stream, remote_addr) {
|
||||
Ok(session_id) => {
|
||||
trace!(target: "net", ?remote_addr, "Incoming connection");
|
||||
return Some(SwarmEvent::IncomingTcpConnection { session_id, remote_addr })
|
||||
}
|
||||
Err(err) => {
|
||||
|
||||
Reference in New Issue
Block a user