From 092ac7a0fd9edfc5ca5321dc41a1c1a11113677b Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 16 Oct 2021 13:06:52 +0300 Subject: [PATCH] Print more information when starting electrs --- src/config.rs | 7 ++++++- src/electrum.rs | 4 +--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index eb61592..34985d9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -9,8 +9,10 @@ use std::net::ToSocketAddrs; use std::path::PathBuf; use std::str::FromStr; +use std::env::consts::{ARCH, OS}; use std::time::Duration; +pub const ELECTRS_VERSION: &str = env!("CARGO_PKG_VERSION"); const DEFAULT_SERVER_ADDRESS: [u8; 4] = [127, 0, 0, 1]; // by default, serve on IPv4 localhost mod internal { @@ -316,7 +318,10 @@ impl Config { server_banner: config.server_banner, args: args.map(|a| a.into_string().unwrap()).collect(), }; - eprintln!("{:?}", config); + eprintln!( + "Starting electrs {} on {} {} with {:?}", + ELECTRS_VERSION, ARCH, OS, config + ); env_logger::Builder::from_default_env() .default_format() .format_timestamp_millis() diff --git a/src/electrum.rs b/src/electrum.rs index a3dfa2c..c9d5071 100644 --- a/src/electrum.rs +++ b/src/electrum.rs @@ -14,7 +14,7 @@ use std::iter::FromIterator; use crate::{ cache::Cache, - config::Config, + config::{Config, ELECTRS_VERSION}, daemon::{self, extract_bitcoind_error, Daemon}, merkle::Proof, metrics::{self, Histogram}, @@ -24,9 +24,7 @@ use crate::{ types::ScriptHash, }; -const ELECTRS_VERSION: &str = env!("CARGO_PKG_VERSION"); const PROTOCOL_VERSION: &str = "1.4"; - const UNKNOWN_FEE: isize = -1; // (allowed by Electrum protocol) /// Per-client Electrum protocol state