MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_opts

Function handle_opts

lightningd/options.c:1412–1433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1410}
1411
1412void handle_opts(struct lightningd *ld, int argc, char *argv[])
1413{
1414 /* Now look for config file, but only handle non-early
1415 * options, early ones have been parsed in
1416 * handle_early_opts */
1417 parse_config_files(ld->config_filename, ld->config_basedir, false);
1418
1419 /* Now parse cmdline, which overrides config. */
1420 opt_parse(&argc, argv, opt_log_stderr_exitcode);
1421 if (argc != 1)
1422 errx(1, "no arguments accepted");
1423 /* We keep a separate variable rather than overriding always_use_proxy,
1424 * so listconfigs shows the correct thing. */
1425 if (tal_count(ld->proposed_wireaddr) != 0
1426 && all_tor_addresses(ld->proposed_wireaddr)) {
1427 ld->pure_tor_setup = true;
1428 if (!ld->proxyaddr)
1429 log_info(ld->log, "Pure Tor setup with no --proxy:"
1430 " you won't be able to make connections out");
1431 }
1432 check_config(ld);
1433}
1434
1435/* FIXME: This is a hack! Expose somehow in ccan/opt.*/
1436/* Returns string after first '-'. */

Callers 1

mainFunction · 0.70

Calls 6

parse_config_filesFunction · 0.85
opt_parseFunction · 0.85
errxFunction · 0.85
all_tor_addressesFunction · 0.85
log_infoClass · 0.85
check_configFunction · 0.85

Tested by

no test coverage detected