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

Function init

plugins/recklessrpc.c:287–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287static const char *init(struct command *init_cmd,
288 const char *buf UNUSED,
289 const jsmntok_t *config UNUSED)
290{
291 plugin = init_cmd->plugin;
292 rpc_scan(init_cmd, "listconfigs",
293 take(json_out_obj(NULL, NULL, NULL)),
294 "{configs:{"
295 "conf?:{value_str:%},"
296 "lightning-dir:{value_str:%},"
297 "network:{value_str:%}"
298 "}}",
299 JSON_SCAN_TAL(plugin, json_strdup, &lconfig.config),
300 JSON_SCAN_TAL(plugin, json_strdup, &lconfig.lightningdir),
301 JSON_SCAN_TAL(plugin, json_strdup, &lconfig.network));
302 /* These lightning config parameters need to stick around for each
303 * reckless call. */
304 if (lconfig.config)
305 notleak(lconfig.config);
306 notleak(lconfig.lightningdir);
307 notleak(lconfig.network);
308 plugin_log(plugin, LOG_DBG, "plugin initialized!");
309 plugin_log(plugin, LOG_DBG, "lightning-dir: %s", lconfig.lightningdir);
310 return NULL;
311}
312
313static const struct plugin_command commands[] = {
314 {

Callers

nothing calls this directly

Calls 3

rpc_scanFunction · 0.70
json_out_objFunction · 0.70
plugin_logFunction · 0.70

Tested by

no test coverage detected