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

Function all_tor_addresses

common/wireaddr.c:915–942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

913}
914
915bool all_tor_addresses(const struct wireaddr_internal *wireaddr)
916{
917 for (int i = 0; i < tal_count(wireaddr); i++) {
918 switch (wireaddr[i].itype) {
919 case ADDR_INTERNAL_SOCKNAME:
920 return false;
921 case ADDR_INTERNAL_FORPROXY:
922 abort();
923 case ADDR_INTERNAL_ALLPROTO:
924 return false;
925 case ADDR_INTERNAL_AUTOTOR:
926 case ADDR_INTERNAL_STATICTOR:
927 continue;
928 case ADDR_INTERNAL_WIREADDR:
929 switch (wireaddr[i].u.wireaddr.wireaddr.type) {
930 case ADDR_TYPE_IPV4:
931 case ADDR_TYPE_IPV6:
932 case ADDR_TYPE_DNS:
933 return false;
934 case ADDR_TYPE_TOR_V2_REMOVED:
935 case ADDR_TYPE_TOR_V3:
936 continue;
937 }
938 }
939 abort();
940 }
941 return true;
942}
943
944/*~ ccan/asort provides a type-safe sorting function; it requires a comparison
945 * 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