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

Function subdaemon_path

lightningd/lightningd.c:420–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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