Unverified Commit 41899310 authored by Roman Zeyde's avatar Roman Zeyde
Browse files

Handle multiple RPC clients in parallel

parent 2fee6ea0
= Electrum
Update height to -1 for txns with any unconfirmed input (https://electrumx.readthedocs.io/en/latest/protocol-basics.html#status)
Snapshot DB after successful indexing - and run queries on this snapshot
Handle multiple RPC client in parallel
Figure out graceful shutting down RPC server
= Bitcoind
......@@ -357,8 +357,11 @@ pub fn start(addr: &SocketAddr, query: Arc<Query>) -> thread::JoinHandle<()> {
info!("RPC server running on {}", addr);
thread::spawn(move || loop {
let (stream, addr) = listener.accept().expect("accept failed");
info!("[{}] connected peer", addr);
Connection::new(query.clone(), stream, addr).run();
info!("[{}] disconnected peer", addr);
let query = query.clone();
thread::spawn(move || {
info!("[{}] connected peer", addr);
Connection::new(query, stream, addr).run();
info!("[{}] disconnected peer", addr);
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