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

Function check_bolt11_condition

lightningd/runes.c:750–773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

748}
749
750static const char *check_bolt11_condition(const tal_t *ctx,
751 const struct rune_altern *alt,
752 const struct bolt11 *b11,
753 enum invoice_field invf)
754{
755
756 switch (invf) {
757 case INV_FIELD_AMOUNT:
758 if (!b11->msat)
759 return rune_alt_single_missing(ctx, alt);
760 return rune_alt_single_int(ctx, alt,
761 b11->msat->millisatoshis /* Raw: rune check */);
762 case INV_FIELD_NODE_ID: {
763 const char *id = fmt_node_id(tmpctx, &b11->receiver_id);
764 return rune_alt_single_str(ctx, alt, id, strlen(id));
765 }
766 case INV_FIELD_DESCRIPTION:
767 if (!b11->description)
768 return rune_alt_single_missing(ctx, alt);
769 return rune_alt_single_str(ctx, alt, b11->description,
770 strlen(b11->description));
771 }
772 abort();
773}
774
775static const char *check_bolt12_condition(const tal_t *ctx,
776 const struct rune_altern *alt,

Callers 1

check_inv_conditionFunction · 0.85

Calls 5

rune_alt_single_missingFunction · 0.85
rune_alt_single_intFunction · 0.85
fmt_node_idFunction · 0.85
rune_alt_single_strFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected