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

Function param_b12_invreq

lightningd/offer.c:412–434  ·  view source on GitHub ↗

FIXME(vincenzopalazzo): move this to comm/bolt12.h */

Source from the content-addressed store, hash-verified

410
411/* FIXME(vincenzopalazzo): move this to comm/bolt12.h */
412static struct command_result *param_b12_invreq(struct command *cmd,
413 const char *name,
414 const char *buffer,
415 const jsmntok_t *tok,
416 struct tlv_invoice_request **invreq)
417{
418 const char *fail;
419
420 *invreq = invrequest_decode(cmd, buffer + tok->start,
421 tok->end - tok->start,
422 cmd->ld->our_features, chainparams, &fail);
423 if (!*invreq)
424 return command_fail_badparam(cmd, name, buffer, tok, fail);
425
426 if (!(*invreq)->invreq_metadata)
427 return command_fail_badparam(cmd, name, buffer, tok,
428 "must have invreq_metadata");
429
430 if (!(*invreq)->invreq_payer_id)
431 return command_fail_badparam(cmd, name, buffer, tok,
432 "must have invreq_payer_id");
433 return NULL;
434}
435
436static bool payer_key(struct lightningd *ld,
437 const u8 *public_tweak, size_t public_tweak_len,

Callers

nothing calls this directly

Calls 2

invrequest_decodeFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected