| 389 | } |
| 390 | |
| 391 | static 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 */ |
| 430 | static void do_clean_timer(void *unused) |
no test coverage detected