Browse Source

lightningd: Add --test-daemons-only option.

ppa-0.6.1
ZmnSCPxj 7 years ago
committed by Christian Decker
parent
commit
c572c3bbee
  1. 2
      lightningd/lightningd.c
  2. 3
      lightningd/lightningd.h
  3. 10
      lightningd/options.c

2
lightningd/lightningd.c

@ -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);

3
lightningd/lightningd.h

@ -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 */

10
lightningd/options.c

@ -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…
Cancel
Save