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

Function invoice_payment_deserialize

lightningd/invoice.c:339–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339static bool
340invoice_payment_deserialize(struct invoice_payment_hook_payload *payload,
341 const char *buffer,
342 const jsmntok_t *toks)
343{
344 struct lightningd *ld = payload->ld;
345 const u8 *failmsg;
346
347 /* If peer dies or something, this can happen. */
348 if (!payload->set) {
349 log_debug(ld->log, "invoice '%s' paying htlc_in has gone!",
350 payload->label->s);
351 return false;
352 }
353
354 /* Did we have a hook result? */
355 failmsg = hook_gives_failmsg(NULL, ld,
356 payload->set->htlcs[0], buffer, toks);
357 if (failmsg) {
358 htlc_set_fail(payload->set, take(failmsg));
359 return false;
360 }
361 return true;
362}
363
364REGISTER_PLUGIN_HOOK(invoice_payment,
365 invoice_payment_deserialize,

Callers

nothing calls this directly

Calls 2

hook_gives_failmsgFunction · 0.85
htlc_set_failFunction · 0.70

Tested by

no test coverage detected