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

Function param_b12_invreq

lightningd/offer.c:370–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370static struct command_result *param_b12_invreq(struct command *cmd,
371 const char *name,
372 const char *buffer,
373 const jsmntok_t *tok,
374 struct tlv_invoice_request **invreq)
375{
376 char *fail;
377
378 *invreq = invrequest_decode(cmd, buffer + tok->start,
379 tok->end - tok->start,
380 cmd->ld->our_features, chainparams, &fail);
381 if (!*invreq)
382 return command_fail_badparam(cmd, name, buffer, tok, fail);
383#if !DEVELOPER
384 /* We use this for testing with known payer_info */
385 if ((*invreq)->payer_info)
386 return command_fail_badparam(cmd, name, buffer, tok,
387 "must not have payer_info");
388#endif
389 if ((*invreq)->payer_key)
390 return command_fail_badparam(cmd, name, buffer, tok,
391 "must not have payer_key");
392 return NULL;
393}
394
395static bool payer_key(struct lightningd *ld,
396 const u8 *public_tweak, size_t public_tweak_len,

Callers

nothing calls this directly

Calls 2

invrequest_decodeFunction · 0.85
command_fail_badparamFunction · 0.85

Tested by

no test coverage detected