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

Function peer_connected_serialize

lightningd/peer_control.c:1431–1445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429};
1430
1431static void
1432peer_connected_serialize(struct peer_connected_hook_payload *payload,
1433 struct json_stream *stream, struct plugin *plugin)
1434{
1435 json_object_start(stream, "peer");
1436 json_add_node_id(stream, "id", &payload->peer_id);
1437 json_add_string(stream, "direction", payload->incoming ? "in" : "out");
1438 json_add_string(stream, "addr",
1439 fmt_wireaddr_internal(tmpctx, &payload->addr));
1440 if (payload->remote_addr)
1441 json_add_string(stream, "remote_addr",
1442 fmt_wireaddr(tmpctx, payload->remote_addr));
1443 json_add_hex_talarr(stream, "features", payload->their_features);
1444 json_object_end(stream); /* .peer */
1445}
1446
1447static bool ignore_idle_channel(const struct lightningd *ld,
1448 const struct channel *channel)

Callers

nothing calls this directly

Calls 7

json_object_startFunction · 0.85
json_add_node_idFunction · 0.85
fmt_wireaddr_internalFunction · 0.85
fmt_wireaddrFunction · 0.85
json_add_hex_talarrFunction · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected