mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
Externalize Grin User Agent (#880)
Take the version from the root Cargo.toml Fixes #875
This commit is contained in:
parent
99804a6485
commit
e32d353543
2 changed files with 4 additions and 2 deletions
|
@ -31,8 +31,8 @@ use types::*;
|
|||
/// Current latest version of the protocol
|
||||
pub const PROTOCOL_VERSION: u32 = 1;
|
||||
|
||||
/// Grin's user agent with current version (TODO externalize)
|
||||
pub const USER_AGENT: &'static str = "MW/Grin 0.1";
|
||||
/// Grin's user agent with current version
|
||||
pub const USER_AGENT: &'static str = concat!("MW/Grin ", env!("CARGO_PKG_VERSION"));
|
||||
|
||||
/// Magic number expected in the header of every message
|
||||
const MAGIC: [u8; 2] = [0x1e, 0xc5];
|
||||
|
|
|
@ -76,6 +76,8 @@ fn peer_handshake() {
|
|||
net_adapter,
|
||||
).unwrap();
|
||||
|
||||
assert!(peer.info.user_agent.ends_with(env!("CARGO_PKG_VERSION")));
|
||||
|
||||
peer.start(socket);
|
||||
thread::sleep(time::Duration::from_secs(1));
|
||||
|
||||
|
|
Loading…
Reference in a new issue