Unverified Commit 878f81cf authored by Roman Zeyde's avatar Roman Zeyde
Browse files

Return correct 'server.version' response

parent f48e395d
......@@ -17,6 +17,9 @@ use crate::metrics::{Gauge, HistogramOpts, HistogramVec, MetricOpts, Metrics};
use crate::query::{Query, Status};
use crate::util::{spawn_thread, Channel, HeaderEntry, SyncChannel};
const ELECTRS_VERSION: &'static str = env!("CARGO_PKG_VERSION");
const PROTOCOL_VERSION: &'static str = "1.4";
// TODO: Sha256dHash should be a generic hash-container (since script hash is single SHA256)
fn hash_from_value(val: Option<&Value>) -> Result<Sha256dHash> {
let script_hash = val.chain_err(|| "missing hash")?;
......@@ -103,7 +106,10 @@ impl Connection {
}
fn server_version(&self) -> Result<Value> {
Ok(json!(["RustElectrum 0.1.0", "1.4"]))
Ok(json!([
format!("electrs {}", ELECTRS_VERSION),
PROTOCOL_VERSION
]))
}
fn server_banner(&self) -> Result<Value> {
......
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