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

Function json_add_blindedpath

lightningd/onion_message.c:25–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23};
24
25static void json_add_blindedpath(struct json_stream *stream,
26 const char *fieldname,
27 const struct pubkey *blinding,
28 const struct pubkey *first_node_id,
29 struct onionmsg_path **path)
30{
31 json_object_start(stream, fieldname);
32 json_add_pubkey(stream, "blinding", blinding);
33 json_add_pubkey(stream, "first_node_id", first_node_id);
34 json_array_start(stream, "hops");
35 for (size_t i = 0; i < tal_count(path); i++) {
36 json_object_start(stream, NULL);
37 json_add_pubkey(stream, "id", &path[i]->node_id);
38 json_add_hex_talarr(stream, "encrypted_recipient_data",
39 path[i]->encrypted_recipient_data);
40 json_object_end(stream);
41 };
42 json_array_end(stream);
43 json_object_end(stream);
44}
45
46static void onion_message_serialize(struct onion_message_hook_payload *payload,
47 struct json_stream *stream,

Callers 2

onion_message_serializeFunction · 0.85
json_blindedpathFunction · 0.85

Calls 6

json_add_pubkeyFunction · 0.85
json_object_startFunction · 0.50
json_array_startFunction · 0.50
json_add_hex_talarrFunction · 0.50
json_object_endFunction · 0.50
json_array_endFunction · 0.50

Tested by

no test coverage detected