Browse Source

interface: set got_disconnected earlier

related: https://github.com/spesmilo/electrum/issues/7677
related: prev commit
patch-4
SomberNight 3 years ago
parent
commit
f4cfc6c7c3
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/interface.py

4
electrum/interface.py

@ -502,7 +502,7 @@ class Interface(Logger):
self.logger.warning(f"disconnecting due to {repr(e)}")
self.logger.debug(f"(disconnect) trace for {repr(e)}", exc_info=True)
finally:
self.got_disconnected.set() # set this ASAP, ideally before any awaits
self.got_disconnected.set()
await self.network.connection_down(self)
# if was not 'ready' yet, schedule waiting coroutines:
self.ready.cancel()
@ -675,6 +675,8 @@ class Interface(Logger):
JSONRPC.METHOD_NOT_FOUND):
raise GracefulDisconnect(e, log_level=logging.WARNING) from e
raise
finally:
self.got_disconnected.set() # set this ASAP, ideally before any awaits
async def monitor_connection(self):
while True:

Loading…
Cancel
Save