diff --git a/src/config.rs b/src/config.rs index 11a6118..4932f24 100644 --- a/src/config.rs +++ b/src/config.rs @@ -43,6 +43,10 @@ fn str_to_socketaddr(address: &str, what: &str) -> SocketAddr { impl Config { pub fn from_args() -> Config { + let default_banner = format!( + "Welcome to electrs {} (Electrum Rust Server)!", + env!("CARGO_PKG_VERSION") + ); let m = App::new("Electrum Rust Server") .version(crate_version!()) .arg( @@ -131,7 +135,7 @@ impl Config { Arg::with_name("server_banner") .long("server-banner") .help("The banner to be shown in the Electrum console") - .default_value("Welcome to electrs (Electrum Rust Server)!") + .default_value(&default_banner) ) .get_matches(); diff --git a/src/rpc.rs b/src/rpc.rs index dda7b6c..05fc3dc 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -514,7 +514,10 @@ impl RPC { spawn_thread("acceptor", move || { let listener = TcpListener::bind(addr).unwrap_or_else(|e| panic!("bind({}) failed: {}", addr, e)); - info!("RPC server running on {}", addr); + info!( + "Electrum RPC server running on {} (protocol {})", + addr, PROTOCOL_VERSION + ); loop { let (stream, addr) = listener.accept().expect("accept failed"); stream