Browse Source

qml: don't initialize swaphelper if a non-lightning wallet is opened

Due to swaphelper's lifecycle (it is kept around longer than the swap dialog) it might
get initialized with a non-lightning wallet. don't initialize in that case.

proper fix is to tie the lifecycle to the swap process, or make it a child of the wallet.
master
Sander van Grieken 3 years ago
parent
commit
72b07a3630
  1. 2
      electrum/gui/qml/qeswaphelper.py

2
electrum/gui/qml/qeswaphelper.py

@ -182,6 +182,8 @@ class QESwapHelper(AuthMixin, QObject):
def init_swap_slider_range(self):
lnworker = self._wallet.wallet.lnworker
if not lnworker:
return
swap_manager = lnworker.swap_manager
try:
asyncio.run(swap_manager.get_pairs())

Loading…
Cancel
Save