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:
parent
f8a577b396
commit
67bf98f238
1 changed files with 1 additions and 2 deletions
|
@ -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()? {
|
||||
|
|
Loading…
Add table
Reference in a new issue