From e415c0d93036d351e406be4aaef5ef000703d969 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 14 May 2019 17:04:03 +0200 Subject: [PATCH] wallet: (fix) synchronizer would also resub closed wallets... network cb was not removed, so Synchronizer and the wallet itself was kept in memory; and Synchronizer kept working --- electrum/gui/qt/__init__.py | 2 +- electrum/util.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index d5b6c9497..0fa9095b1 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -296,7 +296,7 @@ class ElectrumGui(Logger): self.daemon.add_wallet(wallet) return wallet - def close_window(self, window): + def close_window(self, window: ElectrumWindow): if window in self.windows: self.windows.remove(window) self.build_tray_menu() diff --git a/electrum/util.py b/electrum/util.py index 6393c81ce..41d99c9f2 100644 --- a/electrum/util.py +++ b/electrum/util.py @@ -1003,6 +1003,10 @@ class NetworkJobOnDefaultServer(Logger): raise NotImplementedError() # implemented by subclasses async def stop(self): + self.network.unregister_callback(self._restart) + await self._stop() + + async def _stop(self): await self.group.cancel_remaining() @log_exceptions @@ -1012,7 +1016,7 @@ class NetworkJobOnDefaultServer(Logger): return # we should get called again soon async with self._restart_lock: - await self.stop() + await self._stop() self._reset() await self._start(interface)