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

Function init

plugins/topology.c:620–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618#endif
619
620static const char *init(struct plugin *p,
621 const char *buf UNUSED, const jsmntok_t *config UNUSED)
622{
623 size_t num_cupdates_rejected;
624
625 plugin = p;
626 rpc_scan(p, "getinfo",
627 take(json_out_obj(NULL, NULL, NULL)),
628 "{id:%}", JSON_SCAN(json_to_node_id, &local_id));
629
630 global_gossmap = gossmap_load(NULL,
631 GOSSIP_STORE_FILENAME,
632 &num_cupdates_rejected);
633 if (!global_gossmap)
634 plugin_err(plugin, "Could not load gossmap %s: %s",
635 GOSSIP_STORE_FILENAME, strerror(errno));
636
637 if (num_cupdates_rejected)
638 plugin_log(plugin, LOG_DBG,
639 "gossmap ignored %zu channel updates",
640 num_cupdates_rejected);
641#if DEVELOPER
642 plugin_set_memleak_handler(p, memleak_mark);
643#endif
644 return NULL;
645}
646
647static const struct plugin_command commands[] = {
648 {

Callers

nothing calls this directly

Calls 6

rpc_scanFunction · 0.85
json_out_objFunction · 0.85
gossmap_loadFunction · 0.85
plugin_errFunction · 0.70
plugin_logFunction · 0.70

Tested by

no test coverage detected