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

Function param_invoice_payment_hash

plugins/offers_offer.c:228–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static struct command_result *param_invoice_payment_hash(struct command *cmd,
229 const char *name,
230 const char *buffer,
231 const jsmntok_t *tok,
232 struct sha256 **hash)
233{
234 struct tlv_invoice *inv;
235 char *fail;
236
237 inv = invoice_decode(tmpctx, buffer + tok->start, tok->end - tok->start,
238 plugin_feature_set(cmd->plugin), chainparams,
239 &fail);
240 if (!inv)
241 return command_fail_badparam(cmd, name, buffer, tok,
242 tal_fmt(cmd,
243 "Unparsable invoice: %s",
244 fail));
245
246 if (!inv->payment_hash)
247 return command_fail_badparam(cmd, name, buffer, tok,
248 "invoice missing payment_hash");
249
250 *hash = tal_steal(cmd, inv->payment_hash);
251 return NULL;
252}
253
254struct offer_info {
255 const struct tlv_offer *offer;

Callers

nothing calls this directly

Calls 3

plugin_feature_setFunction · 0.85
command_fail_badparamFunction · 0.85
invoice_decodeFunction · 0.50

Tested by

no test coverage detected