mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 23:24:21 +01:00
opt: make sure early cmdline options override config file.
I noticed that --network=regtest didn't override 'network=bitcoin' in the config file. Normally we parse the config file first, then the commandline (so the cmdline wins). But for early options, we do cmdline first so we can find the config file. That was fine when the only early option was the location of the config file, but now it includes plugins and the network setting. So do a boutique cmdline parse *just* to find the config file, then parse the config file early options, then the cmdline early options. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -659,10 +659,6 @@ int main(int argc, char *argv[])
|
||||
if (!ld->daemon_dir)
|
||||
errx(1, "Could not find daemons");
|
||||
|
||||
/*~ The ccan/opt code requires registration then parsing; we
|
||||
* mimic this API here, even though they're on separate lines.*/
|
||||
register_opts(ld);
|
||||
|
||||
/*~ Handle early options, but don't move to --lightning-dir
|
||||
* just yet. Plugins may add new options, which is why we are
|
||||
* splitting between early args (including --plugin
|
||||
|
||||
Reference in New Issue
Block a user