tdns hacks on windows: cache dns when using dnspython - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 6709ec41174300093a5782debe2787f005bd9b07 DIR parent 2d57a689d9bcf36799e1bfb9aa21bcd6a6d048a1 HTML Author: SomberNight <somber.night@protonmail.com> Date: Wed, 1 Jan 2020 06:23:51 +0100 dns hacks on windows: cache dns when using dnspython related #4421 related #5337 Diffstat: M electrum/network.py | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) --- DIR diff --git a/electrum/network.py b/electrum/network.py t@@ -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)