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

Function bolt12_bip353_valid_string

common/bolt12.c:1165–1181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163}
1164
1165bool bolt12_bip353_valid_string(const u8 *str, size_t len)
1166{
1167 /* BOLT #12:
1168 * - if `invreq_bip_353_name` is present:
1169 * - MUST reject the invoice request if `name` or `domain`
1170 * contain any bytes which are not `0`-`9`, `a`-`z`,
1171 * `A`-`Z`, `-`, `_` or `.`.
1172 */
1173 for (size_t i = 0; i < len; i++) {
1174 if (cisalnum(str[i]))
1175 continue;
1176 if (str[i] == '-' || str[i] == '_' || str[i] == '.')
1177 continue;
1178 return false;
1179 }
1180 return true;
1181}
1182
1183const struct recurrence *offer_recurrence(const struct tlv_offer *offer)
1184{

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