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

Function all_tor_addresses

common/wireaddr.c:852–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850}
851
852bool all_tor_addresses(const struct wireaddr_internal *wireaddr)
853{
854 for (int i = 0; i < tal_count(wireaddr); i++) {
855 switch (wireaddr[i].itype) {
856 case ADDR_INTERNAL_SOCKNAME:
857 return false;
858 case ADDR_INTERNAL_FORPROXY:
859 abort();
860 case ADDR_INTERNAL_ALLPROTO:
861 return false;
862 case ADDR_INTERNAL_AUTOTOR:
863 case ADDR_INTERNAL_STATICTOR:
864 continue;
865 case ADDR_INTERNAL_WIREADDR:
866 switch (wireaddr[i].u.wireaddr.type) {
867 case ADDR_TYPE_IPV4:
868 case ADDR_TYPE_IPV6:
869 case ADDR_TYPE_DNS:
870 return false;
871 case ADDR_TYPE_TOR_V2_REMOVED:
872 case ADDR_TYPE_TOR_V3:
873 case ADDR_TYPE_WEBSOCKET:
874 continue;
875 }
876 }
877 abort();
878 }
879 return true;
880}
881
882/*~ ccan/asort provides a type-safe sorting function; it requires a comparison
883 * 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