| 479 | } |
| 480 | |
| 481 | static 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 | |
| 504 | static void configvar_save(struct lightningd *ld, |
| 505 | const char **names, |
no test coverage detected