| 182 | } |
| 183 | |
| 184 | static void json_add_tlv_arr_level(struct json_stream *js, |
| 185 | const char *fieldname, |
| 186 | enum field_layer layer, |
| 187 | const struct tlv_field *fields) |
| 188 | { |
| 189 | json_array_start(js, fieldname); |
| 190 | for (size_t i = 0; i < tal_count(fields); i++) { |
| 191 | const char *name; |
| 192 | |
| 193 | if (tlv_layer(fields[i].numtype) != layer) |
| 194 | continue; |
| 195 | |
| 196 | name = tlv_type_name(fields[i].numtype); |
| 197 | if (name) |
| 198 | json_add_string(js, NULL, name); |
| 199 | else |
| 200 | json_add_u64(js, NULL, fields[i].numtype); |
| 201 | } |
| 202 | json_array_end(js); |
| 203 | } |
| 204 | |
| 205 | /* Output the fields_included arrays for a payer_proof TLV. */ |
| 206 | static void json_add_fields_included(struct json_stream *js, |
no test coverage detected