1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Log electrs and protocol versions

This commit is contained in:
Roman Zeyde 2019-05-18 10:35:47 +03:00
parent 89940cf973
commit 2b52ef3bef
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB
2 changed files with 9 additions and 2 deletions

View File

@ -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();

View File

@ -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