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

Function bolt12_bip353_valid_string

common/bolt12.c:862–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862bool bolt12_bip353_valid_string(const u8 *str, size_t len)
863{
864 /* BOLT #12:
865 * - if `invreq_bip_353_name` is present:
866 * - MUST reject the invoice request if `name` or `domain`
867 * contain any bytes which are not `0`-`9`, `a`-`z`,
868 * `A`-`Z`, `-`, `_` or `.`.
869 */
870 for (size_t i = 0; i < len; i++) {
871 if (cisalnum(str[i]))
872 continue;
873 if (str[i] == '-' || str[i] == '_' || str[i] == '.')
874 continue;
875 return false;
876 }
877 return true;
878}
879
880const struct recurrence *offer_recurrence(const struct tlv_offer *offer)
881{

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