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

Function all_tor_addresses

common/wireaddr.c:893–920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891}
892
893bool all_tor_addresses(const struct wireaddr_internal *wireaddr)
894{
895 for (int i = 0; i < tal_count(wireaddr); i++) {
896 switch (wireaddr[i].itype) {
897 case ADDR_INTERNAL_SOCKNAME:
898 return false;
899 case ADDR_INTERNAL_FORPROXY:
900 abort();
901 case ADDR_INTERNAL_ALLPROTO:
902 return false;
903 case ADDR_INTERNAL_AUTOTOR:
904 case ADDR_INTERNAL_STATICTOR:
905 continue;
906 case ADDR_INTERNAL_WIREADDR:
907 switch (wireaddr[i].u.wireaddr.wireaddr.type) {
908 case ADDR_TYPE_IPV4:
909 case ADDR_TYPE_IPV6:
910 case ADDR_TYPE_DNS:
911 return false;
912 case ADDR_TYPE_TOR_V2_REMOVED:
913 case ADDR_TYPE_TOR_V3:
914 continue;
915 }
916 }
917 abort();
918 }
919 return true;
920}
921
922/*~ ccan/asort provides a type-safe sorting function; it requires a comparison
923 * function, which takes an optional extra argument which is usually unused as

Callers 1

handle_optsFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected