BOLT #11: * * `d` (13): `data_length` variable. Short description of purpose of payment * (UTF-8), e.g. '1 cup of coffee' or 'ナンセンス 1杯' */
| 198 | * (UTF-8), e.g. '1 cup of coffee' or 'ナンセンス 1杯' |
| 199 | */ |
| 200 | static const char *decode_d(struct bolt11 *b11, |
| 201 | const struct feature_set *our_features, |
| 202 | struct hash_u5 *hu5, |
| 203 | const u5 **data, size_t *field_len, |
| 204 | bool *have_d) |
| 205 | { |
| 206 | u8 *desc; |
| 207 | const char *err; |
| 208 | |
| 209 | assert(!*have_d); |
| 210 | desc = pull_all(NULL, hu5, data, field_len, false, &err); |
| 211 | if (!desc) |
| 212 | return err; |
| 213 | |
| 214 | *have_d = true; |
| 215 | b11->description = utf8_str(b11, take(desc), tal_bytelen(desc)); |
| 216 | if (b11->description) |
| 217 | return NULL; |
| 218 | |
| 219 | return tal_fmt(b11, "d: invalid utf8"); |
| 220 | } |
| 221 | |
| 222 | /* BOLT #11: |
| 223 | * |
nothing calls this directly
no test coverage detected