mirror of
https://github.com/romanz/electrs.git
synced 2025-02-24 15:02:21 +01:00
Log progress while waiting for IBD
This commit is contained in:
parent
f0a7a325af
commit
d3ec1942f0
1 changed files with 7 additions and 2 deletions
|
@ -105,6 +105,7 @@ struct BlockchainInfo {
|
|||
chain: String,
|
||||
blocks: u32,
|
||||
headers: u32,
|
||||
verificationprogress: f64,
|
||||
bestblockhash: String,
|
||||
pruned: bool,
|
||||
initialblockdownload: bool,
|
||||
|
@ -343,10 +344,14 @@ impl Daemon {
|
|||
bail!("pruned node is not supported (use '-prune=0' bitcoind flag)".to_owned())
|
||||
}
|
||||
loop {
|
||||
if !daemon.getblockchaininfo()?.initialblockdownload {
|
||||
let info = daemon.getblockchaininfo()?;
|
||||
if !info.initialblockdownload {
|
||||
break;
|
||||
}
|
||||
warn!("wait until bitcoind is synced (i.e. initialblockdownload = false)");
|
||||
warn!(
|
||||
"wait until IBD is over: headers={} blocks={} progress={}",
|
||||
info.headers, info.blocks, info.verificationprogress
|
||||
);
|
||||
signal.wait(Duration::from_secs(3))?;
|
||||
}
|
||||
Ok(daemon)
|
||||
|
|
Loading…
Add table
Reference in a new issue