From 72b07a3630558088e49e5affb72189a065726b85 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 3 Mar 2023 10:53:03 +0100 Subject: [PATCH] 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. --- electrum/gui/qml/qeswaphelper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electrum/gui/qml/qeswaphelper.py b/electrum/gui/qml/qeswaphelper.py index 511835108..34282809d 100644 --- a/electrum/gui/qml/qeswaphelper.py +++ b/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())