@@ -66,6 +66,9 @@ struct bitcoind {
6666
6767 /* Override in case we're developer mode for testing*/
6868 bool dev_no_fake_fees ;
69+
70+ /* Override initialblockdownload (using canned blocks sets this) */
71+ bool dev_ignore_ibd ;
6972};
7073
7174static struct bitcoind * bitcoind ;
@@ -477,6 +480,9 @@ static struct command_result *process_getblockchaininfo(struct bitcoin_cli *bcli
477480 if (err )
478481 return command_err_bcli_badjson (bcli , err );
479482
483+ if (bitcoind -> dev_ignore_ibd )
484+ ibd = false;
485+
480486 response = jsonrpc_stream_success (bcli -> cmd );
481487 json_add_string (response , "chain" , chain );
482488 json_add_u32 (response , "headercount" , headers );
@@ -1176,6 +1182,7 @@ static struct bitcoind *new_bitcoind(const tal_t *ctx)
11761182 although normal rpcclienttimeout default value is 900. */
11771183 bitcoind -> rpcclienttimeout = 60 ;
11781184 bitcoind -> dev_no_fake_fees = false;
1185+ bitcoind -> dev_ignore_ibd = false;
11791186
11801187 return bitcoind ;
11811188}
@@ -1227,5 +1234,9 @@ int main(int argc, char *argv[])
12271234 "bool" ,
12281235 "Suppress fee faking for regtest" ,
12291236 bool_option , NULL , & bitcoind -> dev_no_fake_fees ),
1237+ plugin_option_dev ("dev-ignore-ibd" ,
1238+ "bool" ,
1239+ "Never tell lightningd we're doing initial block download" ,
1240+ bool_option , NULL , & bitcoind -> dev_ignore_ibd ),
12301241 NULL );
12311242}
0 commit comments