Browse Source

interface: check if future already done in handle_disconnect

future could get cancelled in network.py in which case set_result raised
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight 6 years ago
parent
commit
935ab9a12f
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/interface.py

1
electrum/interface.py

@ -336,6 +336,7 @@ class Interface(Logger):
self.logger.debug(f"(disconnect) trace for {repr(e)}", exc_info=True)
finally:
await self.network.connection_down(self)
if not self.got_disconnected.done():
self.got_disconnected.set_result(1)
# if was not 'ready' yet, schedule waiting coroutines:
self.ready.cancel()

Loading…
Cancel
Save