| 16 | }; |
| 17 | |
| 18 | static void json_add_blindedpath(struct plugin *plugin, |
| 19 | struct json_stream *stream, |
| 20 | const char *fieldname, |
| 21 | const struct blinded_path *path) |
| 22 | { |
| 23 | json_object_start(stream, fieldname); |
| 24 | if (path->first_node_id.is_pubkey) { |
| 25 | json_add_pubkey(stream, "first_node_id", &path->first_node_id.pubkey); |
| 26 | } else { |
| 27 | json_add_short_channel_id(stream, "first_scid", path->first_node_id.scidd.scid); |
| 28 | json_add_u32(stream, "first_scid_dir", path->first_node_id.scidd.dir); |
| 29 | } |
| 30 | json_add_pubkey(stream, "first_path_key", &path->first_path_key); |
| 31 | json_array_start(stream, "hops"); |
| 32 | for (size_t i = 0; i < tal_count(path->path); i++) { |
| 33 | json_object_start(stream, NULL); |
| 34 | json_add_pubkey(stream, "blinded_node_id", |
| 35 | &path->path[i]->blinded_node_id); |
| 36 | json_add_hex_talarr(stream, "encrypted_recipient_data", |
| 37 | path->path[i]->encrypted_recipient_data); |
| 38 | json_object_end(stream); |
| 39 | }; |
| 40 | json_array_end(stream); |
| 41 | json_object_end(stream); |
| 42 | } |
| 43 | |
| 44 | static void onion_message_serialize(struct onion_message_hook_payload *payload, |
| 45 | struct json_stream *stream, |
no test coverage detected