1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-24 15:02:21 +01:00

Respond to SIGINT during indexing phase

This commit is contained in:
Roman Zeyde 2018-06-11 12:39:52 +03:00
parent f8a577b396
commit 67bf98f238
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

View file

@ -16,8 +16,6 @@ use electrs::{app::{App, Waiter},
fn run_server(config: &Config) -> Result<()> {
let daemon = Daemon::new(config.network_type)?;
let signal = Waiter::new(Duration::from_secs(5));
let store = DBStore::open(
&config.db_path,
StoreOptions {
@ -35,6 +33,7 @@ fn run_server(config: &Config) -> Result<()> {
let query = Query::new(app.clone());
let rpc = RPC::start(config.rpc_addr, query.clone());
let signal = Waiter::new(Duration::from_secs(5));
while let None = signal.wait() {
query.update_mempool()?;
if tip != app.daemon().getbestblockhash()? {