| 365 | } |
| 366 | |
| 367 | static char *opt_subdaemon(const char *arg, struct lightningd *ld) |
| 368 | { |
| 369 | char *subdaemon; |
| 370 | char *sdpath; |
| 371 | |
| 372 | /* example arg: "hsmd:remote_hsmd" */ |
| 373 | |
| 374 | size_t colonoff = strcspn(arg, ":"); |
| 375 | if (!arg[colonoff]) |
| 376 | return tal_fmt(tmpctx, "argument must contain ':'"); |
| 377 | |
| 378 | subdaemon = tal_strndup(ld, arg, colonoff); |
| 379 | if (!is_subdaemon(subdaemon)) |
| 380 | return tal_fmt(tmpctx, "\"%s\" is not a subdaemon", subdaemon); |
| 381 | |
| 382 | /* Make the value a tal-child of the subdaemon */ |
| 383 | sdpath = tal_strdup(subdaemon, arg + colonoff + 1); |
| 384 | |
| 385 | /* Remove any preexisting alt subdaemon mapping (and |
| 386 | * implicitly, the sdpath). */ |
| 387 | tal_free(strmap_del(&ld->alt_subdaemons, subdaemon, NULL)); |
| 388 | |
| 389 | strmap_add(&ld->alt_subdaemons, subdaemon, sdpath); |
| 390 | |
| 391 | return NULL; |
| 392 | } |
| 393 | |
| 394 | static bool opt_show_u64(char *buf, size_t len, const u64 *u) |
| 395 | { |
nothing calls this directly
no test coverage detected