diff --git a/parity/main.rs b/parity/main.rs index 1b1ca27e6..6fffa4b53 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -594,10 +594,8 @@ impl Configuration { } else { None }; + let rpc_handle = rpc_server.map(|server| { - panic_handler.forward_from(&server); - server - }).map(|server| { let url = format!("{}:{}", match self.args.flag_rpcaddr.as_ref().unwrap_or(&self.args.flag_jsonrpc_interface).as_str() { "all" => "0.0.0.0", diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 119d12a0f..9787db9cd 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -33,8 +33,6 @@ extern crate ethminer; extern crate transient_hashmap; use std::sync::Arc; -use std::thread; -use util::panics::{MayPanic, PanicHandler, OnPanicListener}; use self::jsonrpc_core::{IoHandler, IoDelegate}; pub use jsonrpc_http_server::{Listening, RpcServerError}; @@ -43,7 +41,6 @@ pub mod v1; /// Http server. pub struct RpcServer { handler: Arc, - panic_handler: Arc } impl RpcServer { @@ -51,7 +48,6 @@ impl RpcServer { pub fn new() -> RpcServer { RpcServer { handler: Arc::new(IoHandler::new()), - panic_handler: PanicHandler::new_in_arc(), } } @@ -64,20 +60,8 @@ impl RpcServer { pub fn start_http(&self, addr: &str, cors_domain: &str, threads: usize) -> Result { let addr = addr.to_owned(); let cors_domain = cors_domain.to_owned(); - let ph = self.panic_handler.clone(); let server = jsonrpc_http_server::Server::new(self.handler.clone()); - thread::Builder::new().name("jsonrpc_http".to_string()).spawn(move || { - ph.catch_panic(move || { - server.start(addr.as_ref(), jsonrpc_http_server::AccessControlAllowOrigin::Value(cors_domain), threads) - }).unwrap() - }).expect("Error while creating jsonrpc http thread").join().unwrap() + server.start(addr.as_ref(), jsonrpc_http_server::AccessControlAllowOrigin::Value(cors_domain), threads) } } - -impl MayPanic for RpcServer { - fn on_panic(&self, closure: F) where F: OnPanicListener { - self.panic_handler.on_panic(closure); - } -} -