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

Function fmt_wireaddr_internal

common/wireaddr.c:231–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 10

websocket_connection_inFunction · 0.85
destroy_io_connFunction · 0.85
try_connect_one_addrFunction · 0.85
make_listen_fdFunction · 0.85
connect_activateFunction · 0.85
wallet_peer_saveFunction · 0.85
opt_add_addr_withtypeFunction · 0.85
peer_connected_serializeFunction · 0.85
json_add_peerFunction · 0.85
json_connectFunction · 0.85

Calls 2

fmt_wireaddrFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected