Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/electrum/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ impl Connection {
"merkle" : merkle}))
}

fn unknown_method(&self, method: &str) -> Result<Value> {
Ok(json!(format!("unknown method {}", method)))
}

fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result<Value> {
let timer = self
.stats
Expand Down Expand Up @@ -424,7 +428,7 @@ impl Connection {
#[cfg(feature = "electrum-discovery")]
"server.add_peer" => self.server_add_peer(&params),

&_ => bail!("unknown method {} {:?}", method, params),
&_ => self.unknown_method(&method),
};
timer.observe_duration();
// TODO: return application errors should be sent to the client
Expand Down