electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit ef2a6359e4521cef4302486a2b9844814938babf
parent 637e65efe3c329a80b0625d8fb3496a5ab8e5e62
Author: SomberNight <somber.night@protonmail.com>
Date:   Sun, 21 Oct 2018 03:09:47 +0200

fix SSL log spam on py3.7

based on kyuupichan/electrumx@83813ff1ac71da6030f7181d3c8fe961491a51f3
see pooler/electrum-ltc#191

Diffstat:
Melectrum/network.py | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/electrum/network.py b/electrum/network.py @@ -221,6 +221,7 @@ class Network(PrintError): self.proxy = None self.asyncio_loop = asyncio.get_event_loop() + self.asyncio_loop.set_exception_handler(self.on_event_loop_exception) #self.asyncio_loop.set_debug(1) self._run_forever = asyncio.Future() self._thread = threading.Thread(target=self.asyncio_loop.run_until_complete, @@ -237,6 +238,15 @@ class Network(PrintError): def get_instance(): return INSTANCE + def on_event_loop_exception(self, loop, context): + """Suppress spurious messages it appears we cannot control.""" + SUPPRESS_MESSAGE_REGEX = re.compile('SSL handshake|Fatal read error on|' + 'SSL error in data received') + message = context.get('message') + if message and SUPPRESS_MESSAGE_REGEX.match(message): + return + loop.default_exception_handler(context) + def with_recent_servers_lock(func): def func_wrapper(self, *args, **kwargs): with self.recent_servers_lock: