| 821 | } |
| 822 | |
| 823 | struct wireaddr *fromwire_wireaddr_array(const tal_t *ctx, const u8 *ser) |
| 824 | { |
| 825 | const u8 *cursor = ser; |
| 826 | size_t len = tal_count(ser); |
| 827 | struct wireaddr *wireaddrs = tal_arr(ctx, struct wireaddr, 0); |
| 828 | |
| 829 | while (cursor && len) { |
| 830 | struct wireaddr wireaddr; |
| 831 | |
| 832 | /* BOLT #7: |
| 833 | * |
| 834 | * The receiving node: |
| 835 | *... |
| 836 | * - SHOULD ignore the first `address descriptor` that does |
| 837 | * NOT match the types defined above. |
| 838 | */ |
| 839 | if (!fromwire_wireaddr(&cursor, &len, &wireaddr)) { |
| 840 | if (!cursor) |
| 841 | /* Parsing address failed */ |
| 842 | return tal_free(wireaddrs); |
| 843 | /* Unknown type, stop there. */ |
| 844 | break; |
| 845 | } |
| 846 | |
| 847 | tal_arr_expand(&wireaddrs, wireaddr); |
| 848 | } |
| 849 | return wireaddrs; |
| 850 | } |
| 851 | |
| 852 | bool all_tor_addresses(const struct wireaddr_internal *wireaddr) |
| 853 | { |
no test coverage detected