Unverified Commit 2b52ef3b authored by Roman Zeyde's avatar Roman Zeyde
Browse files

Log electrs and protocol versions

parent 89940cf9
......@@ -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();
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment