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

Function bolt12_bip353_valid_string

common/bolt12.c:882–898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882bool bolt12_bip353_valid_string(const u8 *str, size_t len)
883{
884 /* BOLT #12:
885 * - if `invreq_bip_353_name` is present:
886 * - MUST reject the invoice request if `name` or `domain`
887 * contain any bytes which are not `0`-`9`, `a`-`z`,
888 * `A`-`Z`, `-`, `_` or `.`.
889 */
890 for (size_t i = 0; i < len; i++) {
891 if (cisalnum(str[i]))
892 continue;
893 if (str[i] == '-' || str[i] == '_' || str[i] == '.')
894 continue;
895 return false;
896 }
897 return true;
898}
899
900const struct recurrence *offer_recurrence(const struct tlv_offer *offer)
901{

Callers 3

handle_invoice_requestFunction · 0.85
json_add_invreq_fieldsFunction · 0.85
print_bip353_nameFunction · 0.85

Calls 1

cisalnumFunction · 0.85

Tested by

no test coverage detected