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

Function init

plugins/offers.c:920–940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918}
919
920static const char *init(struct plugin *p,
921 const char *buf UNUSED,
922 const jsmntok_t *config UNUSED)
923{
924 struct pubkey k;
925
926 rpc_scan(p, "getinfo",
927 take(json_out_obj(NULL, NULL, NULL)),
928 "{id:%}", JSON_SCAN(json_to_pubkey, &k));
929 if (secp256k1_xonly_pubkey_from_pubkey(secp256k1_ctx, &id.pubkey,
930 NULL, &k.pubkey) != 1)
931 abort();
932
933 rpc_scan(p, "listconfigs",
934 take(json_out_obj(NULL, NULL, NULL)),
935 "{cltv-final:%,experimental-offers:%}",
936 JSON_SCAN(json_to_u16, &cltv_final),
937 JSON_SCAN(json_to_bool, &offers_enabled));
938
939 return NULL;
940}
941
942static const struct plugin_command commands[] = {
943 {

Callers

nothing calls this directly

Calls 3

rpc_scanFunction · 0.85
json_out_objFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected