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

Function fromwire_wireaddr_array

common/wireaddr.c:823–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821}
822
823struct 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
852bool all_tor_addresses(const struct wireaddr_internal *wireaddr)
853{

Callers 3

get_node_announcementFunction · 0.85
handle_node_announcementFunction · 0.85
json_add_nodeFunction · 0.85

Calls 2

fromwire_wireaddrFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected