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

Function json_add_tlv_arr_level

plugins/offers_proof.c:184–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184static 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. */
206static void json_add_fields_included(struct json_stream *js,

Callers 1

json_add_fields_includedFunction · 0.85

Calls 6

json_array_startFunction · 0.85
tlv_layerFunction · 0.85
tlv_type_nameFunction · 0.85
json_add_u64Function · 0.85
json_array_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected