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:
parent
89940cf973
commit
2b52ef3bef
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user