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

Function create_setconfig_include

lightningd/configs.c:482–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482static void create_setconfig_include(struct lightningd *ld)
483{
484 const char *lines;
485 time_t now = time(NULL);
486 const char *fname;
487 bool must_exist;
488
489 /* Usually config.setconfig, but could be different with --conf */
490 fname = base_conf_file(tmpctx, ld, &must_exist);
491 ld->setconfig_file = tal_fmt(ld, "%s.setconfig", fname);
492
493 /* We want to use a relative path here (ctime() includes \n!). */
494 lines = tal_fmt(tmpctx,
495 "# Inserted by setconfig %sinclude %s.setconfig",
496 ctime(&now), path_basename(tmpctx, fname));
497 append_to_file(ld, fname, lines, must_exist);
498
499 /* This creates the file */
500 append_to_file(ld, ld->setconfig_file,
501 "# Created and update by setconfig, but you can edit this manually when node is stopped.",
502 false);
503}
504
505static void configvar_save(struct lightningd *ld,
506 const char **names,

Callers 2

configvar_saveFunction · 0.85
configvar_save_multiFunction · 0.85

Calls 3

base_conf_fileFunction · 0.85
path_basenameFunction · 0.85
append_to_fileFunction · 0.85

Tested by

no test coverage detected