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

Function subdaemon_path

lightningd/lightningd.c:422–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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