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

Function init

plugins/fetchinvoice.c:1808–1825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1806};
1807
1808static const char *init(struct plugin *p, const char *buf UNUSED,
1809 const jsmntok_t *config UNUSED)
1810{
1811 bool exp_offers;
1812
1813 rpc_scan(p, "getinfo",
1814 take(json_out_obj(NULL, NULL, NULL)),
1815 "{id:%}", JSON_SCAN(json_to_pubkey, &local_id));
1816
1817 rpc_scan(p, "listconfigs",
1818 take(json_out_obj(NULL, "config", "experimental-offers")),
1819 "{experimental-offers:%}",
1820 JSON_SCAN(json_to_bool, &exp_offers));
1821
1822 if (!exp_offers)
1823 return "offers not enabled in config";
1824 return NULL;
1825}
1826
1827static const struct plugin_hook hooks[] = {
1828 {

Callers

nothing calls this directly

Calls 2

rpc_scanFunction · 0.85
json_out_objFunction · 0.85

Tested by

no test coverage detected