Browse Source
dns hacks on windows: cache dns when using dnspython
related #4421
related #5337
hard-fail-on-bad-server-string
SomberNight
5 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
0 deletions
-
electrum/network.py
|
|
@ -564,6 +564,9 @@ class Network(Logger): |
|
|
|
# when dns-resolving. To speed it up drastically, we resolve dns ourselves, outside that lock. |
|
|
|
# see #4421 |
|
|
|
socket.getaddrinfo = self._fast_getaddrinfo |
|
|
|
resolver = dns.resolver.get_default_resolver() |
|
|
|
if resolver.cache is None: |
|
|
|
resolver.cache = dns.resolver.Cache() |
|
|
|
else: |
|
|
|
socket.getaddrinfo = socket._getaddrinfo |
|
|
|
self.trigger_callback('proxy_set', self.proxy) |
|
|
|