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

Function fmt_wireaddr_internal

common/wireaddr.c:247–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247char *fmt_wireaddr_internal(const tal_t *ctx,
248 const struct wireaddr_internal *a)
249{
250 switch (a->itype) {
251 case ADDR_INTERNAL_SOCKNAME:
252 return tal_fmt(ctx, "%s", a->u.sockname);
253 case ADDR_INTERNAL_ALLPROTO:
254 return tal_fmt(ctx, "%s:%u", a->u.allproto.is_websocket ? "(ws)": "",
255 a->u.allproto.port);
256 case ADDR_INTERNAL_WIREADDR:
257 if (a->u.wireaddr.is_websocket)
258 return tal_fmt(ctx, "(ws)%s",
259 fmt_wireaddr(tmpctx, &a->u.wireaddr.wireaddr));
260 return fmt_wireaddr(ctx, &a->u.wireaddr.wireaddr);
261 case ADDR_INTERNAL_FORPROXY:
262 return tal_fmt(ctx, "%s:%u",
263 a->u.unresolved.name, a->u.unresolved.port);
264 case ADDR_INTERNAL_AUTOTOR:
265 return tal_fmt(ctx, "autotor:%s",
266 fmt_wireaddr(tmpctx, &a->u.torservice.address));
267 case ADDR_INTERNAL_STATICTOR:
268 return tal_fmt(ctx, "statictor:%s",
269 fmt_wireaddr(tmpctx, &a->u.torservice.address));
270}
271 abort();
272}
273
274char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a)
275{

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