From 4d95452ae706e0c29a6abd6a64547c8e7cae9567 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 31 Aug 2018 20:56:58 +0200 Subject: [PATCH] wallet: partial fix for race in on_default_server_changed --- electrum/address_synchronizer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/address_synchronizer.py b/electrum/address_synchronizer.py index ab19dab2e..65a754026 100644 --- a/electrum/address_synchronizer.py +++ b/electrum/address_synchronizer.py @@ -142,10 +142,12 @@ class AddressSynchronizer(PrintError): if not i.done(): i.cancel() self.network.futures.clear() + if self.network.interface is None: + return + # FIXME there are races here.. network.interface can become None self.network.futures.append(asyncio.get_event_loop().create_task(self.verifier.main())) self.network.futures.append(asyncio.get_event_loop().create_task(self.synchronizer.send_subscriptions())) self.network.futures.append(asyncio.get_event_loop().create_task(self.synchronizer.handle_status())) - assert self.network.interface.session is not None self.network.futures.append(asyncio.get_event_loop().create_task(self.synchronizer.main())) def start_threads(self, network):