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

Function json_add_layers

plugins/askrene/layer.c:1344–1362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1342}
1343
1344void json_add_layers(struct json_stream *js,
1345 const struct askrene *askrene,
1346 const char *fieldname,
1347 const struct layer *layer)
1348{
1349 json_array_start(js, fieldname);
1350 if (layer) {
1351 json_add_layer(js, NULL, layer);
1352 } else {
1353 struct layer_name_hash_iter it;
1354
1355 for (struct layer *l = layer_name_hash_first(askrene->layers, &it);
1356 l;
1357 l = layer_name_hash_next(askrene->layers, &it)) {
1358 json_add_layer(js, NULL, l);
1359 }
1360 }
1361 json_array_end(js);
1362}
1363
1364bool layer_created(const struct layer *layer, struct short_channel_id scid)
1365{

Callers 2

json_askrene_listlayersFunction · 0.85

Calls 3

json_array_startFunction · 0.85
json_add_layerFunction · 0.85
json_array_endFunction · 0.85

Tested by

no test coverage detected