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

Function peer_connected_serialize

lightningd/peer_control.c:1055–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1053};
1054
1055static void
1056peer_connected_serialize(struct peer_connected_hook_payload *payload,
1057 struct json_stream *stream, struct plugin *plugin)
1058{
1059 const struct peer *p = payload->peer;
1060 json_object_start(stream, "peer");
1061 json_add_node_id(stream, "id", &p->id);
1062 json_add_string(stream, "direction", payload->incoming ? "in" : "out");
1063 json_add_string(
1064 stream, "addr",
1065 type_to_string(stream, struct wireaddr_internal, &payload->addr));
1066 if (payload->remote_addr)
1067 json_add_string(
1068 stream, "remote_addr",
1069 type_to_string(stream, struct wireaddr, payload->remote_addr));
1070 json_add_hex_talarr(stream, "features", p->their_features);
1071 json_object_end(stream); /* .peer */
1072}
1073
1074/* Talk to connectd about an active channel */
1075static void connect_activate_subd(struct lightningd *ld, struct channel *channel)

Callers

nothing calls this directly

Calls 6

json_object_startFunction · 0.50
json_add_node_idFunction · 0.50
json_add_stringFunction · 0.50
type_to_stringClass · 0.50
json_add_hex_talarrFunction · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected