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

Function init

plugins/autoclean.c:803–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803static const char *init(struct command *init_cmd,
804 const char *buf UNUSED, const jsmntok_t *config UNUSED)
805{
806 struct subsystem_and_variant sv;
807 plugin = init_cmd->plugin;
808
809 /* Plugin owns global */
810 tal_steal(plugin, timer_cinfo);
811 plugin_set_memleak_handler(plugin, memleak_mark_timer_cinfo);
812
813 cleantimer = global_timer(plugin, time_from_sec(cycle_seconds), do_clean_timer, NULL);
814
815 /* We don't care if this fails (it usually does, since entries
816 * don't exist! */
817 sv = first_sv();
818 do {
819 rpc_scan_datastore_str(tmpctx, init_cmd,
820 datastore_path(tmpctx, &sv, "num"),
821 JSON_SCAN(json_to_u64, total_cleaned(&sv)));
822 } while (next_sv(&sv));
823
824 /* Optimization FTW! */
825 rpc_enable_batching(plugin);
826 return NULL;
827}
828
829static char *cycle_seconds_option(struct command *cmd, const char *arg,
830 bool check_only,

Callers

nothing calls this directly

Calls 8

time_from_secFunction · 0.85
first_svFunction · 0.85
rpc_scan_datastore_strFunction · 0.85
datastore_pathFunction · 0.85
total_cleanedFunction · 0.85
next_svFunction · 0.85
rpc_enable_batchingFunction · 0.85

Tested by

no test coverage detected