mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
lightningd: Add --test-daemons-only option.
This commit is contained in:
parent
e559f2cb2e
commit
c572c3bbee
@ -81,7 +81,7 @@ static const char *daemons[] = {
|
||||
};
|
||||
|
||||
/* Check we can run them, and check their versions */
|
||||
static void test_daemons(const struct lightningd *ld)
|
||||
void test_daemons(const struct lightningd *ld)
|
||||
{
|
||||
size_t i;
|
||||
const tal_t *ctx = tal_tmpctx(ld);
|
||||
|
@ -175,4 +175,7 @@ struct chainparams *get_chainparams(const struct lightningd *ld);
|
||||
/* State for performing backtraces. */
|
||||
struct backtrace_state *backtrace_state;
|
||||
|
||||
/* Check we can run subdaemons, and check their versions */
|
||||
void test_daemons(const struct lightningd *ld);
|
||||
|
||||
#endif /* LIGHTNING_LIGHTNINGD_LIGHTNINGD_H */
|
||||
|
@ -516,6 +516,13 @@ static void opt_parse_from_config(struct lightningd *ld)
|
||||
tal_free(contents);
|
||||
}
|
||||
|
||||
static char *test_daemons_and_exit(struct lightningd *ld)
|
||||
{
|
||||
test_daemons(ld);
|
||||
exit(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void register_opts(struct lightningd *ld)
|
||||
{
|
||||
opt_set_alloc(opt_allocfn, tal_reallocfn, tal_freefn);
|
||||
@ -524,6 +531,9 @@ void register_opts(struct lightningd *ld)
|
||||
"\n"
|
||||
"A bitcoin lightning daemon.",
|
||||
"Print this message.");
|
||||
opt_register_early_noarg("--test-daemons-only",
|
||||
test_daemons_and_exit,
|
||||
ld, opt_hidden);
|
||||
opt_register_arg("--port", opt_set_u16, opt_show_u16, &ld->portnum,
|
||||
"Port to bind to (0 means don't listen)");
|
||||
opt_register_arg("--bitcoin-datadir", opt_set_talstr, NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user