MCPcopy Create free account
hub / github.com/ElementsProject/elements / test_ipv6_local

Function test_ipv6_local

test/functional/test_framework/netutil.py:143–155  ·  view source on GitHub ↗

Check for (local) IPv6 support.

()

Source from the content-addressed store, hash-verified

141 return bytearray(addr).hex()
142
143def test_ipv6_local():
144 '''
145 Check for (local) IPv6 support.
146 '''
147 # By using SOCK_DGRAM this will not actually make a connection, but it will
148 # fail if there is no route to IPv6 localhost.
149 have_ipv6 = True
150 try:
151 s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
152 s.connect(('::1', 1))
153 except socket.error:
154 have_ipv6 = False
155 return have_ipv6

Callers 3

run_testMethod · 0.90
setup_nodesMethod · 0.90
test_ipv6Method · 0.90

Calls 1

connectMethod · 0.80

Tested by

no test coverage detected