From 1abe9c4e51498abe613e4bd390498d49a2eb6a15 Mon Sep 17 00:00:00 2001 From: Gustavo Spier Landtreter Date: Sat, 20 Apr 2024 01:54:17 -0300 Subject: [PATCH] Fixed regression introduced by #51 Commit merged as part of #51 introduced a regression that prevents the daemon from breaking from its startup wait loop when running in `regtest` mode, and the blockchain already contains 1 or more blocks (apart from genesis). This commit fixes the regression by only checking the equivalence between blocks and headers as the wait condition when running in `regtest` mode. --- src/daemon.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/daemon.rs b/src/daemon.rs index 254c168..3f370bf 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -341,10 +341,10 @@ impl Daemon { let mempool = daemon.getmempoolinfo()?; let ibd_done = if network.is_regtest() { - info.blocks == 0 && info.headers == 0 + info.blocks == info.headers } else { - false - } || !info.initialblockdownload.unwrap_or(false); + !info.initialblockdownload.unwrap_or(false) + }; if mempool.loaded && ibd_done && info.blocks == info.headers { break;