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

Function subdaemon_path

lightningd/lightningd.c:419–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419const char *subdaemon_path(const tal_t *ctx, const struct lightningd *ld, const char *name)
420{
421 /* Strip the leading "lightning_" before looking in alt_subdaemons.
422 */
423 size_t pfxlen = strlen("lightning_");
424 assert(strlen(name) > pfxlen);
425 const char *short_name = tal_strdup(ctx, name + pfxlen);
426
427 /* Is there an alternate path for this subdaemon? */
428 const char *dpath;
429 const char *alt = strmap_get(&ld->alt_subdaemons, short_name);
430 if (alt) {
431 /* path_join will honor absolute paths as well. */
432 dpath = path_join(ctx, ld->subdaemon_dir, alt);
433 } else {
434 /* This subdaemon is found in the standard place. */
435 dpath = path_join(ctx, ld->subdaemon_dir, name);
436 }
437 return dpath;
438}
439
440/*~ Check we can run them, and check their versions */
441void test_subdaemons(const struct lightningd *ld)

Callers 4

new_subdFunction · 0.70
gossip_initFunction · 0.70
connectd_initFunction · 0.70
test_subdaemonsFunction · 0.70

Calls 1

path_joinFunction · 0.85

Tested by 1

test_subdaemonsFunction · 0.56