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

Function fmt_wireaddr_internal

common/wireaddr.c:236–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236char *fmt_wireaddr_internal(const tal_t *ctx,
237 const struct wireaddr_internal *a)
238{
239 switch (a->itype) {
240 case ADDR_INTERNAL_SOCKNAME:
241 return tal_fmt(ctx, "%s", a->u.sockname);
242 case ADDR_INTERNAL_ALLPROTO:
243 return tal_fmt(ctx, ":%u", a->u.port);
244 case ADDR_INTERNAL_WIREADDR:
245 return fmt_wireaddr(ctx, &a->u.wireaddr);
246 case ADDR_INTERNAL_FORPROXY:
247 return tal_fmt(ctx, "%s:%u",
248 a->u.unresolved.name, a->u.unresolved.port);
249 case ADDR_INTERNAL_AUTOTOR:
250 return tal_fmt(ctx, "autotor:%s",
251 fmt_wireaddr(tmpctx, &a->u.torservice.address));
252 case ADDR_INTERNAL_STATICTOR:
253 return tal_fmt(ctx, "statictor:%s",
254 fmt_wireaddr(tmpctx, &a->u.torservice.address));
255}
256 abort();
257}
258REGISTER_TYPE_TO_STRING(wireaddr_internal, fmt_wireaddr_internal);
259
260char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a)

Callers 1

json_add_opt_addrsFunction · 0.85

Calls 2

fmt_wireaddrFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected