Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Improve logging when remote peer is unknown #10817

Merged
merged 1 commit into from
Jul 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion util/network-devp2p/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ impl Connection {

/// Get remote peer address string
pub fn remote_addr_str(&self) -> String {
self.socket.peer_addr().map(|a| a.to_string()).unwrap_or_else(|_| "Unknown".to_owned())
self.socket.peer_addr().map(|a| a.to_string()).unwrap_or_else(|err| {
debug!("error occurred getting peer_addr: {}, connection token: {}", err, self.token);
"Unknown peer address".to_owned()
})
}

/// Get local peer address string
Expand Down