mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +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 */
|
/* 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;
|
size_t i;
|
||||||
const tal_t *ctx = tal_tmpctx(ld);
|
const tal_t *ctx = tal_tmpctx(ld);
|
||||||
|
@ -175,4 +175,7 @@ struct chainparams *get_chainparams(const struct lightningd *ld);
|
|||||||
/* State for performing backtraces. */
|
/* State for performing backtraces. */
|
||||||
struct backtrace_state *backtrace_state;
|
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 */
|
#endif /* LIGHTNING_LIGHTNINGD_LIGHTNINGD_H */
|
||||||
|
@ -516,6 +516,13 @@ static void opt_parse_from_config(struct lightningd *ld)
|
|||||||
tal_free(contents);
|
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)
|
void register_opts(struct lightningd *ld)
|
||||||
{
|
{
|
||||||
opt_set_alloc(opt_allocfn, tal_reallocfn, tal_freefn);
|
opt_set_alloc(opt_allocfn, tal_reallocfn, tal_freefn);
|
||||||
@ -524,6 +531,9 @@ void register_opts(struct lightningd *ld)
|
|||||||
"\n"
|
"\n"
|
||||||
"A bitcoin lightning daemon.",
|
"A bitcoin lightning daemon.",
|
||||||
"Print this message.");
|
"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,
|
opt_register_arg("--port", opt_set_u16, opt_show_u16, &ld->portnum,
|
||||||
"Port to bind to (0 means don't listen)");
|
"Port to bind to (0 means don't listen)");
|
||||||
opt_register_arg("--bitcoin-datadir", opt_set_talstr, NULL,
|
opt_register_arg("--bitcoin-datadir", opt_set_talstr, NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user