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

Function json_add_layers

plugins/askrene/layer.c:1315–1333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1313}
1314
1315void json_add_layers(struct json_stream *js,
1316 const struct askrene *askrene,
1317 const char *fieldname,
1318 const struct layer *layer)
1319{
1320 json_array_start(js, fieldname);
1321 if (layer) {
1322 json_add_layer(js, NULL, layer);
1323 } else {
1324 struct layer_name_hash_iter it;
1325
1326 for (struct layer *l = layer_name_hash_first(askrene->layers, &it);
1327 l;
1328 l = layer_name_hash_next(askrene->layers, &it)) {
1329 json_add_layer(js, NULL, l);
1330 }
1331 }
1332 json_array_end(js);
1333}
1334
1335bool layer_created(const struct layer *layer, struct short_channel_id scid)
1336{

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