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.
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user