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

Function new_bolt11

common/bolt11.c:632–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632struct bolt11 *new_bolt11(const tal_t *ctx,
633 const struct amount_msat *msat TAKES)
634{
635 struct bolt11 *b11 = tal(ctx, struct bolt11);
636
637 list_head_init(&b11->extra_fields);
638 b11->description = NULL;
639 b11->description_hash = NULL;
640 b11->fallbacks = NULL;
641 b11->routes = NULL;
642 b11->msat = NULL;
643 b11->expiry = DEFAULT_X;
644 b11->features = tal_arr(b11, u8, 0);
645 /* BOLT #11:
646 * - if the `c` field (`min_final_cltv_expiry_delta`) is not provided:
647 * - MUST use an expiry delta of at least 18 when making the payment
648 */
649 b11->min_final_cltv_expiry = 18;
650 b11->payment_secret = NULL;
651 b11->metadata = NULL;
652
653 if (msat)
654 b11->msat = tal_dup(b11, struct amount_msat, msat);
655 return b11;
656}
657
658struct decoder {
659 /* What BOLT11 letter this is */

Callers 3

json_invoiceFunction · 0.85
bolt11_decode_nosigFunction · 0.85
mainFunction · 0.85

Calls 1

list_head_initFunction · 0.85

Tested by 1

mainFunction · 0.68