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

Function json_askrene_age

plugins/askrene/askrene.c:1424–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1422}
1423
1424static struct command_result *json_askrene_age(struct command *cmd,
1425 const char *buffer,
1426 const jsmntok_t *params)
1427{
1428 struct layer *layer;
1429 struct json_stream *response;
1430 u64 *cutoff;
1431 size_t num_removed;
1432
1433 if (!param(cmd, buffer, params,
1434 p_req("layer", param_known_layer, &layer),
1435 p_req("cutoff", param_u64, &cutoff),
1436 NULL))
1437 return command_param_failed();
1438 plugin_log(cmd->plugin, LOG_TRACE, "%s called: %.*s", __func__,
1439 json_tok_full_len(params), json_tok_full(buffer, params));
1440
1441 num_removed = layer_trim_constraints(layer, *cutoff);
1442
1443 response = jsonrpc_stream_success(cmd);
1444 json_add_string(response, "layer", layer_name(layer));
1445 json_add_u64(response, "num_removed", num_removed);
1446 return command_finished(cmd, response);
1447}
1448
1449static const struct plugin_command commands[] = {
1450 {

Callers

nothing calls this directly

Calls 11

layer_trim_constraintsFunction · 0.85
layer_nameFunction · 0.85
json_add_u64Function · 0.85
paramFunction · 0.50
command_param_failedFunction · 0.50
plugin_logFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50
jsonrpc_stream_successFunction · 0.50
json_add_stringFunction · 0.50
command_finishedFunction · 0.50

Tested by

no test coverage detected