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

Function start_clean

plugins/autoclean.c:667–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665}
666
667static struct command_result *start_clean(struct clean_info *cinfo)
668{
669 cinfo->cleanup_reqs_remaining = 0;
670
671 /* We have to get max indexes first. */
672 for (size_t i = 0; i < NUM_SUBSYSTEM_TYPES; i++) {
673 struct per_subsystem *ps = &cinfo->per_subsystem[i];
674 const struct subsystem_ops *ops = get_subsystem_ops(ps);
675 struct out_req *req;
676
677 /* Reset counters while we're here */
678 ps->num_uncleaned = 0;
679 for (enum subsystem_variant j = 0; j < NUM_SUBSYSTEM_VARIANTS; j++) {
680 struct per_variant *pv = &ps->variants[j];
681 pv->num_cleaned = 0;
682 }
683 ps->offset = 0;
684
685 req = jsonrpc_request_start(cinfo->cmd,
686 "wait",
687 wait_done, plugin_broken_cb, ps);
688 json_add_string(req->js, "subsystem", ops->system_name);
689 json_add_string(req->js, "indexname", "created");
690 json_add_u64(req->js, "nextvalue", 0);
691 send_outreq(req);
692 cinfo->cleanup_reqs_remaining++;
693 }
694
695 return command_still_pending(cinfo->cmd);
696}
697
698/* Needs a different signature than do_clean */
699static struct command_result *do_clean_timer(struct command *cmd, void *unused)

Callers 2

do_clean_timerFunction · 0.85
json_autoclean_onceFunction · 0.85

Calls 5

get_subsystem_opsFunction · 0.85
json_add_u64Function · 0.85
send_outreqFunction · 0.70
command_still_pendingFunction · 0.70
json_add_stringFunction · 0.50

Tested by

no test coverage detected