From fdd42ae537113429df57febd45087ec0eb50b478 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Feb 2016 17:57:22 +0100 Subject: [PATCH] Improve version string. --- util/Cargo.toml | 1 + util/src/lib.rs | 1 + util/src/network/host.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/util/Cargo.toml b/util/Cargo.toml index 5f57deca3..3c70df8d6 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -28,3 +28,4 @@ sha3 = { path = "sha3" } serde = "0.6.7" clippy = "0.0.37" json-tests = { path = "json-tests" } +target_info = "0.1.0" \ No newline at end of file diff --git a/util/src/lib.rs b/util/src/lib.rs index 622fc950b..5264cadc6 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -34,6 +34,7 @@ //! sudo make install //! ``` +extern crate target_info; extern crate slab; extern crate rustc_serialize; extern crate mio; diff --git a/util/src/network/host.rs b/util/src/network/host.rs index 95b1e3668..4e0ae6092 100644 --- a/util/src/network/host.rs +++ b/util/src/network/host.rs @@ -7,6 +7,7 @@ use std::ops::*; use mio::*; use mio::tcp::*; use mio::udp::*; +use target_info::Target; use hash::*; use crypto::*; use sha3::Hashable; @@ -280,7 +281,7 @@ impl Host where Message: Send + Sync + Clone { config: config, nonce: H256::random(), protocol_version: 4, - client_version: "parity".to_owned(), + client_version: format!("Parity/{}/{}-{}-{}", env!("CARGO_PKG_VERSION"), Target::arch(), Target::env(), Target::os()), listen_port: 0, capabilities: Vec::new(), }),