lightningd: add --dev-ignore-idb to not complain about bitcoind in initialblockdownload.
What changed, and why it matters
This commit adds a hidden developer-only command-line flag called --dev-ignore-ibd to Core Lightning's Bitcoin backend plugin. When enabled, it tells the plugin to lie to the main lightning daemon and claim that Bitcoin is not in 'initial block download' mode, even if it actually is. This is intended only for developer testing scenarios (for example, when using canned/fake blocks) and is not exposed as a normal user option. There is no indication in the commit that this is a security fix or that it addresses a reported vulnerability.
No security action required. This is a developer/testing-only feature. Operators should not enable --dev-ignore-ibd on production nodes because it disables a safety check that prevents Core Lightning from running against a Bitcoin backend that has not finished synchronizing. If reviewing for hardening, consider ensuring the option is rejected or ignored when not compiled in developer mode.
Security signals we found
New developer-only flag that suppresses a safety check (initial block download detection)
No authentication, authorization, or input validation changes
No cryptographic, network, or memory-safety changes
No mention of CVE, security bug, vulnerability, or incident in commit message or diff
Evidence from the diff
The patch modifies plugins/bcli.c to introduce a new boolean field dev_ignore_ibd on the bitcoind struct, defaulting to false. It registers a developer-only plugin option –dev-ignore-ibd via plugin_option_dev(). In process_getblockchaininfo(), if dev_ignore_ibd is true, the local ibd variable is forced to false before the JSON-RPC response is constructed and returned to lightningd. This suppresses the normal behavior where lightningd would complain or wait when bitcoind reports initialblockdownload=true. The change is gated behind a dev-only option and is clearly labeled for testing use.
Changed components
plugins/bcli.cprocess_getblockchaininfo()new_bitcoind()main() option registrationInspect captured patch +11 / −0
diff --git a/plugins/bcli.c b/plugins/bcli.c
index faa155c7..51ff4942 100644
--- a/plugins/bcli.c
+++ b/plugins/bcli.c
@@ -66,6 +66,9 @@ struct bitcoind {
/* Override in case we're developer mode for testing*/
bool dev_no_fake_fees;
+
+ /* Override initialblockdownload (using canned blocks sets this) */
+ bool dev_ignore_ibd;
};
static struct bitcoind *bitcoind;
@@ -477,6 +480,9 @@ static struct command_result *process_getblockchaininfo(struct bitcoin_cli *bcli
if (err)
return command_err_bcli_badjson(bcli, err);
+ if (bitcoind->dev_ignore_ibd)
+ ibd = false;
+
response = jsonrpc_stream_success(bcli->cmd);
json_add_string(response, "chain", chain);
json_add_u32(response, "headercount", headers);
@@ -1176,6 +1182,7 @@ static struct bitcoind *new_bitcoind(const tal_t *ctx)
although normal rpcclienttimeout default value is 900. */
bitcoind->rpcclienttimeout = 60;
bitcoind->dev_no_fake_fees = false;
+ bitcoind->dev_ignore_ibd = false;
return bitcoind;
}
@@ -1227,5 +1234,9 @@ int main(int argc, char *argv[])
"bool",
"Suppress fee faking for regtest",
bool_option, NULL, &bitcoind->dev_no_fake_fees),
+ plugin_option_dev("dev-ignore-ibd",
+ "bool",
+ "Never tell lightningd we're doing initial block download",
+ bool_option, NULL, &bitcoind->dev_ignore_ibd),
NULL);
}
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.