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

Function peer_connected_serialize

lightningd/peer_control.c:1366–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1364};
1365
1366static void
1367peer_connected_serialize(struct peer_connected_hook_payload *payload,
1368 struct json_stream *stream, struct plugin *plugin)
1369{
1370 json_object_start(stream, "peer");
1371 json_add_node_id(stream, "id", &payload->peer_id);
1372 json_add_string(stream, "direction", payload->incoming ? "in" : "out");
1373 json_add_string(stream, "addr",
1374 fmt_wireaddr_internal(tmpctx, &payload->addr));
1375 if (payload->remote_addr)
1376 json_add_string(stream, "remote_addr",
1377 fmt_wireaddr(tmpctx, payload->remote_addr));
1378 json_add_hex_talarr(stream, "features", payload->their_features);
1379 json_object_end(stream); /* .peer */
1380}
1381
1382static bool ignore_idle_channel(const struct lightningd *ld,
1383 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