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

Function init

plugins/autoclean.c:554–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552}
553
554static const char *init(struct plugin *p,
555 const char *buf UNUSED, const jsmntok_t *config UNUSED)
556{
557 plugin = p;
558 if (deprecated_cycle_seconds != UINT64_MAX) {
559 if (deprecated_cycle_seconds == 0) {
560 plugin_log(p, LOG_DBG, "autocleaning not active");
561 return NULL;
562 } else
563 cycle_seconds = deprecated_cycle_seconds;
564 }
565
566 cleantimer = plugin_timer(p, time_from_sec(cycle_seconds), do_clean_timer, NULL);
567
568 for (enum subsystem i = 0; i < NUM_SUBSYSTEM; i++) {
569 rpc_scan_datastore_str(plugin, datastore_path(tmpctx, i, "num"),
570 JSON_SCAN(json_to_u64, &total_cleaned[i]));
571 }
572
573 /* Optimization FTW! */
574 rpc_enable_batching(p);
575 return NULL;
576}
577
578static const struct plugin_command commands[] = { {
579 "autocleaninvoice",

Callers

nothing calls this directly

Calls 6

time_from_secFunction · 0.85
rpc_scan_datastore_strFunction · 0.85
datastore_pathFunction · 0.85
rpc_enable_batchingFunction · 0.85
plugin_logFunction · 0.70
plugin_timerClass · 0.70

Tested by

no test coverage detected