electrum

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

commit 935ab9a12f4cd6cf8e06c7207fafda72bb6ea1c7
parent c6a54f05f5ba431e069cba0eef14a2df1e596c14
Author: SomberNight <somber.night@protonmail.com>
Date:   Fri, 28 Jun 2019 21:13:33 +0200

interface: check if future already done in handle_disconnect

future could get cancelled in network.py in which case set_result raised

Diffstat:
Melectrum/interface.py | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/electrum/interface.py b/electrum/interface.py @@ -336,7 +336,8 @@ class Interface(Logger): self.logger.debug(f"(disconnect) trace for {repr(e)}", exc_info=True) finally: await self.network.connection_down(self) - self.got_disconnected.set_result(1) + if not self.got_disconnected.done(): + self.got_disconnected.set_result(1) # if was not 'ready' yet, schedule waiting coroutines: self.ready.cancel() return wrapper_func