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

Function json_myadd_blinded_path

plugins/renepay/json.c:373–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373void json_myadd_blinded_path(struct json_stream *s,
374 const char *fieldname,
375 const struct blinded_path *blinded_path)
376{
377 // FIXME: how can we support the case when the entry point is a
378 // scid?
379 assert(blinded_path->first_node_id.is_pubkey);
380 json_object_start(s, fieldname);
381 json_add_pubkey(s, "first_node_id",
382 &blinded_path->first_node_id.pubkey);
383 json_add_pubkey(s, "first_path_key", &blinded_path->first_path_key);
384 json_array_start(s, "path");
385 for (size_t i = 0; i < tal_count(blinded_path->path); i++) {
386 const struct blinded_path_hop *hop = blinded_path->path[i];
387 json_object_start(s, NULL);
388 json_add_pubkey(s, "blinded_node_id", &hop->blinded_node_id);
389 json_add_hex_talarr(s, "encrypted_recipient_data",
390 hop->encrypted_recipient_data);
391 json_object_end(s);
392 }
393 json_array_end(s);
394 json_object_end(s);
395}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected