From 49dc380381837ed1cccd2c87baa527e70e633e6d Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Thu, 25 Jun 2020 10:21:19 +0300 Subject: [PATCH] Don't check for `initialblockdownload` on regtest And check for `headers == blocks` on all networks. Refs #45, #35 --- src/app.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index 9e19fa0..f8afea4 100644 --- a/src/app.rs +++ b/src/app.rs @@ -152,8 +152,9 @@ fn wait_bitcoind(rpc: &RpcClient) -> Result<()> { trace!("{:?}", bcinfo); let dur = time::Duration::from_secs(15); - while bcinfo.initial_block_download { - /* || bcinfo.blocks < bcinfo.headers */ + while (bcinfo.chain != "regtest" && bcinfo.initial_block_download) + || bcinfo.blocks < bcinfo.headers + { info!( "waiting for bitcoind to sync [{}/{} blocks, ibd={}]", bcinfo.blocks, bcinfo.headers, bcinfo.initial_block_download