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

Function opt_set_alias

lightningd/options.c:453–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453static char *opt_set_alias(const char *arg, struct lightningd *ld)
454{
455 assert(arg != NULL);
456
457 ld->alias = tal_free(ld->alias);
458 /* BOLT #7:
459 *
460 * * [`32*byte`:`alias`]
461 *...
462 * - MUST set `alias` to a valid UTF-8 string, with any
463 * `alias` trailing-bytes equal to 0.
464 */
465 if (strlen(arg) > 32)
466 return tal_fmt(tmpctx, "Alias '%s' is over 32 characters", arg);
467 ld->alias = tal_arrz(ld, u8, 33);
468 strncpy((char*)ld->alias, arg, 32);
469 return NULL;
470}
471
472static char *opt_set_offline(struct lightningd *ld)
473{

Callers

nothing calls this directly

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected