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

Function subdaemon_path

lightningd/lightningd.c:341–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339#endif /* DEVELOPER */
340
341const char *subdaemon_path(const tal_t *ctx, const struct lightningd *ld, const char *name)
342{
343 /* Strip the leading "lightning_" before looking in alt_subdaemons.
344 */
345 size_t pfxlen = strlen("lightning_");
346 assert(strlen(name) > pfxlen);
347 const char *short_name = tal_strdup(ctx, name + pfxlen);
348
349 /* Is there an alternate path for this subdaemon? */
350 const char *dpath;
351 const char *alt = strmap_get(&ld->alt_subdaemons, short_name);
352 if (alt) {
353 /* path_join will honor absolute paths as well. */
354 dpath = path_join(ctx, ld->daemon_dir, alt);
355 } else {
356 /* This subdaemon is found in the standard place. */
357 dpath = path_join(ctx, ld->daemon_dir, name);
358 }
359 return dpath;
360}
361
362/*~ Check we can run them, and check their versions */
363void test_subdaemons(const struct lightningd *ld)

Callers 3

new_subdFunction · 0.70
connectd_initFunction · 0.70
test_subdaemonsFunction · 0.70

Calls 1

path_joinFunction · 0.85

Tested by 1

test_subdaemonsFunction · 0.56