core-lightning/lightningd/options.h
Rusty Russell f68c9fa9c9 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>
2019-07-27 05:16:22 +00:00

20 lines
643 B
C

#ifndef LIGHTNING_LIGHTNINGD_OPTIONS_H
#define LIGHTNING_LIGHTNINGD_OPTIONS_H
#include "config.h"
#include <ccan/tal/tal.h>
struct lightningd;
/* After this, early config file and cmdline options parsed. */
void handle_early_opts(struct lightningd *ld, int argc, char *argv[]);
/* After this we're in the .lightning dir, and we've parsed all options */
void handle_opts(struct lightningd *ld, int argc, char *argv[]);
/* Derive default color and alias from the pubkey. */
void setup_color_and_alias(struct lightningd *ld);
/* Global to allow deprecated options. */
extern bool deprecated_apis;
#endif /* LIGHTNING_LIGHTNINGD_OPTIONS_H */