Add debug name in node infos (#1769)

This commit is contained in:
Pierre Krieger
2019-02-12 18:03:46 +01:00
committed by Gav Wood
parent 22048dba60
commit 6e26c52191
@@ -342,8 +342,8 @@ where TMessage: CustomMessage + Send + 'static {
/// Get debug info for a given peer.
pub fn peer_debug_info(&self, who: NodeIndex) -> String {
if let (Some(peer_id), Some(addr)) = (self.peer_id_of_node(who), self.node_endpoint(who)) {
format!("{:?} through {:?}", peer_id, addr)
if let Some(info) = self.nodes_info.get(&who) {
format!("{:?} (version: {:?}) through {:?}", info.peer_id, info.client_version, info.endpoint)
} else {
"unknown".to_string()
}