Keep node information about disconnection (#2596)

* Keep node information about disconnection

* Fix line widths
This commit is contained in:
Pierre Krieger
2019-05-15 18:11:41 +02:00
committed by Gavin Wood
parent 2893a613c2
commit c4e3970d9f
5 changed files with 454 additions and 175 deletions
+6 -2
View File
@@ -247,6 +247,10 @@ pub struct NetworkStatePeer {
pub struct NetworkStateNotConnectedPeer {
/// List of addresses known for this node.
pub known_addresses: HashSet<Multiaddr>,
/// Node information, as provided by the node itself, if we were ever connected to this node.
pub version_string: Option<String>,
/// Latest ping duration with this node, if we were ever connected to this node.
pub latest_ping_time: Option<Duration>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
@@ -270,8 +274,8 @@ impl From<ConnectedPoint> for NetworkStatePeerEndpoint {
NetworkStatePeerEndpoint::Dialing(address),
ConnectedPoint::Listener { listen_addr, send_back_addr } =>
NetworkStatePeerEndpoint::Listening {
listen_addr: listen_addr,
send_back_addr: send_back_addr
listen_addr,
send_back_addr
}
}
}