1
0
Fork 0
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:
Roman Zeyde 2020-04-24 20:22:51 +03:00
parent f0a7a325af
commit d3ec1942f0
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

View file

@ -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)