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

Function check_bolt11_condition

lightningd/runes.c:719–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717}
718
719static const char *check_bolt11_condition(const tal_t *ctx,
720 const struct rune_altern *alt,
721 const struct bolt11 *b11,
722 enum invoice_field invf)
723{
724
725 switch (invf) {
726 case INV_FIELD_AMOUNT:
727 if (!b11->msat)
728 return rune_alt_single_missing(ctx, alt);
729 return rune_alt_single_int(ctx, alt,
730 b11->msat->millisatoshis /* Raw: rune check */);
731 case INV_FIELD_NODE_ID: {
732 const char *id = fmt_node_id(tmpctx, &b11->receiver_id);
733 return rune_alt_single_str(ctx, alt, id, strlen(id));
734 }
735 case INV_FIELD_DESCRIPTION:
736 if (!b11->description)
737 return rune_alt_single_missing(ctx, alt);
738 return rune_alt_single_str(ctx, alt, b11->description,
739 strlen(b11->description));
740 }
741 abort();
742}
743
744static const char *check_bolt12_condition(const tal_t *ctx,
745 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