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

Function json_success_subsystems

plugins/autoclean.c:721–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721static struct command_result *json_success_subsystems(struct command *cmd,
722 const struct subsystem_and_variant *single)
723{
724 struct json_stream *response = jsonrpc_stream_success(cmd);
725 struct subsystem_and_variant sv = first_sv();
726
727 json_object_start(response, "autoclean");
728 do {
729 struct per_variant *pv;
730 if (single &&
731 (sv.type != single->type || sv.variant != single->variant))
732 continue;
733
734 /* Some don't have both success and failure */
735 if (!subsystem_to_str(&sv))
736 continue;
737
738 pv = &timer_cinfo->per_subsystem[sv.type].variants[sv.variant];
739 json_object_start(response, subsystem_to_str(&sv));
740 json_add_bool(response, "enabled", pv->age != 0);
741 if (pv->age != 0)
742 json_add_u64(response, "age", pv->age);
743 json_add_u64(response, "cleaned", *total_cleaned(&sv));
744 json_object_end(response);
745 } while (next_sv(&sv));
746 json_object_end(response);
747 return command_finished(cmd, response);
748}
749
750static struct command_result *json_autoclean_status(struct command *cmd,
751 const char *buffer,

Callers 1

json_autoclean_statusFunction · 0.85

Calls 10

first_svFunction · 0.85
json_object_startFunction · 0.85
subsystem_to_strFunction · 0.85
json_add_boolFunction · 0.85
json_add_u64Function · 0.85
total_cleanedFunction · 0.85
json_object_endFunction · 0.85
next_svFunction · 0.85
jsonrpc_stream_successFunction · 0.70
command_finishedFunction · 0.70

Tested by

no test coverage detected