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

Function create_setconfig_include

lightningd/configs.c:481–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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