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

Function param_preimage

lightningd/invoice.c:1097–1110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1095}
1096
1097static struct command_result *param_preimage(struct command *cmd,
1098 const char *name,
1099 const char *buffer,
1100 const jsmntok_t *tok,
1101 struct preimage **preimage)
1102{
1103 *preimage = tal(cmd, struct preimage);
1104 if (!hex_decode(buffer + tok->start, tok->end - tok->start,
1105 *preimage, sizeof(**preimage)))
1106 return command_fail_badparam(cmd, "preimage",
1107 buffer, tok,
1108 "should be 64 hex digits");
1109 return NULL;
1110}
1111
1112static struct command_result *json_invoice(struct command *cmd,
1113 const char *buffer,

Callers

nothing calls this directly

Calls 2

hex_decodeFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected