Browse Source

follow-up prev: fix race between load_wallet and network events

[127.0.0.1] Exception in wrapper_func : AttributeError 'ElectrumWindow' object has no attribute 'wallet'
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 839, in f2
    return await f(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/interface.py", line 245, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/interface.py", line 260, in run
    await self.open_session(ssl_context, exit_early=False)
  File "/home/user/wspace/electrum/electrum/interface.py", line 357, in open_session
    await group.spawn(self.monitor_connection())
  File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 241, in __aexit__
    await self.join(wait=self._wait)
  File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 214, in join
    raise task.exception()
  File "/home/user/wspace/electrum/electrum/address_synchronizer.py", line 173, in job
    await group.spawn(self.synchronizer.main())
  File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 241, in __aexit__
    await self.join(wait=self._wait)
  File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 214, in join
    raise task.exception()
  File "/home/user/wspace/electrum/electrum/synchronizer.py", line 181, in main
    self.wallet.network.trigger_callback('wallet_updated', self.wallet)
  File "/home/user/wspace/electrum/electrum/network.py", line 267, in trigger_callback
    callback(event, *args)
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 300, in on_network
    if wallet == self.wallet:
AttributeError: 'ElectrumWindow' object has no attribute 'wallet'
3.3.3.1
SomberNight 6 years ago
parent
commit
7e1a784fca
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qt/main_window.py

2
electrum/gui/qt/main_window.py

@ -107,6 +107,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.setup_exception_hook()
self.network = gui_object.daemon.network
self.wallet = wallet
self.fx = gui_object.daemon.fx
self.invoices = wallet.invoices
self.contacts = wallet.contacts
@ -356,7 +357,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
@profiler
def load_wallet(self, wallet):
wallet.thread = TaskThread(self, self.on_error)
self.wallet = wallet
self.update_recently_visited(wallet.storage.path)
# update(==init) all tabs; expensive for large wallets..
# so delay it somewhat, hence __init__ can finish and the window can appear sooner

Loading…
Cancel
Save