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

Function do_clean

plugins/autoclean.c:391–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391static struct command_result *do_clean(struct clean_info *cinfo)
392{
393 struct out_req *req = NULL;
394
395 cinfo->cleanup_reqs_remaining = 0;
396 cinfo->num_uncleaned = 0;
397 memset(cinfo->num_cleaned, 0, sizeof(cinfo->num_cleaned));
398
399 if (cinfo->subsystem_age[SUCCEEDEDPAYS] != 0
400 || cinfo->subsystem_age[FAILEDPAYS] != 0) {
401 req = jsonrpc_request_start(plugin, NULL, "listsendpays",
402 listsendpays_done, listsendpays_failed,
403 cinfo);
404 send_outreq(plugin, req);
405 }
406
407 if (cinfo->subsystem_age[EXPIREDINVOICES] != 0
408 || cinfo->subsystem_age[PAIDINVOICES] != 0) {
409 req = jsonrpc_request_start(plugin, NULL, "listinvoices",
410 listinvoices_done, listinvoices_failed,
411 cinfo);
412 send_outreq(plugin, req);
413 }
414
415 if (cinfo->subsystem_age[SUCCEEDEDFORWARDS] != 0
416 || cinfo->subsystem_age[FAILEDFORWARDS] != 0) {
417 req = jsonrpc_request_start(plugin, NULL, "listforwards",
418 listforwards_done, listforwards_failed,
419 cinfo);
420 send_outreq(plugin, req);
421 }
422
423 if (req)
424 return command_still_pending(NULL);
425 else
426 return clean_finished(cinfo);
427}
428
429/* Needs a different signature than do_clean */
430static void do_clean_timer(void *unused)

Callers 2

do_clean_timerFunction · 0.85
json_autoclean_onceFunction · 0.85

Calls 3

clean_finishedFunction · 0.85
send_outreqFunction · 0.70
command_still_pendingFunction · 0.70

Tested by

no test coverage detected