BOLT #11: * * `m` (27): `data_length` variable. Additional metadata to attach to * the payment. Note that the size of this field is limited by the * maximum hop payload size. Long metadata fields reduce the maximum * route length. */
| 543 | * route length. |
| 544 | */ |
| 545 | static char *decode_m(struct bolt11 *b11, |
| 546 | struct hash_u5 *hu5, |
| 547 | u5 **data, size_t *data_len, |
| 548 | size_t data_length, |
| 549 | bool *have_m) |
| 550 | { |
| 551 | size_t mlen = (data_length * 5) / 8; |
| 552 | |
| 553 | if (*have_m) |
| 554 | return unknown_field(b11, hu5, data, data_len, 'm', |
| 555 | data_length); |
| 556 | |
| 557 | b11->metadata = tal_arr(b11, u8, mlen); |
| 558 | pull_bits_certain(hu5, data, data_len, b11->metadata, |
| 559 | data_length * 5, false); |
| 560 | |
| 561 | *have_m = true; |
| 562 | return NULL; |
| 563 | } |
| 564 | |
| 565 | struct bolt11 *new_bolt11(const tal_t *ctx, |
| 566 | const struct amount_msat *msat TAKES) |
no test coverage detected