Store identification info about the remote (#1500)

* Store identification info about the remote

* Add node name on the wire

* Fix tests
This commit is contained in:
Pierre Krieger
2019-01-21 14:33:25 +01:00
committed by Gav Wood
parent 010e63116f
commit f67c2cc181
5 changed files with 142 additions and 34 deletions
+5 -2
View File
@@ -52,8 +52,10 @@ pub struct NetworkConfiguration {
pub reserved_nodes: Vec<String>,
/// The non-reserved peer mode.
pub non_reserved_mode: NonReservedPeerMode,
/// Client identifier
/// Client identifier. Sent over the wire for debugging purposes.
pub client_version: String,
/// Name of the node. Sent over the wire for debugging purposes.
pub node_name: String,
}
impl Default for NetworkConfiguration {
@@ -80,7 +82,8 @@ impl NetworkConfiguration {
out_peers: 75,
reserved_nodes: Vec::new(),
non_reserved_mode: NonReservedPeerMode::Accept,
client_version: "Parity-network".into(), // TODO: meh
client_version: "unknown".into(),
node_name: "unknown".into(),
}
}