From 956b45595406d79c5fee58154b0387825f827b8a Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sat, 16 Sep 2023 02:21:23 +0000 Subject: [PATCH] qt tx dlg: follow-up "send tx change to lightning" lnworker is None if lightning is disabled. follow-up 649ce979abfeb18a285dec792d455ecf137c6382 ``` 15.14 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter Traceback (most recent call last): File "...\electrum\electrum\gui\qt\rate_limiter.py", line 231, in wrapper return RateLimiter.invoke(rate, ts_after, func, args, kwargs) File "...\electrum\electrum\gui\qt\rate_limiter.py", line 79, in invoke return rl._invoke(args, kwargs) File "...\electrum\electrum\gui\qt\rate_limiter.py", line 91, in _invoke return self._doIt() File "...\electrum\electrum\gui\qt\rate_limiter.py", line 120, in _doIt retval = self.func(*args, **kwargs) # and.. call the function. use latest invocation's args File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 745, in _throttled_update self.update() File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 750, in update self.io_widget.update(self.tx) File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 243, in update insert_tx_io( File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 205, in insert_tx_io tcf_addr = addr_text_format(addr) File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 173, in addr_text_format sm = self.wallet.lnworker.swap_manager AttributeError: 'NoneType' object has no attribute 'swap_manager' ``` --- electrum/gui/qt/transaction_dialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py index d693c7323..28479b038 100644 --- a/electrum/gui/qt/transaction_dialog.py +++ b/electrum/gui/qt/transaction_dialog.py @@ -170,7 +170,7 @@ class TxInOutWidget(QWidget): tf_used_recv, tf_used_change, tf_used_2fa, tf_used_swap = False, False, False, False def addr_text_format(addr: str) -> QTextCharFormat: nonlocal tf_used_recv, tf_used_change, tf_used_2fa, tf_used_swap - sm = self.wallet.lnworker.swap_manager + sm = self.wallet.lnworker.swap_manager if self.wallet.lnworker else None if self.wallet.is_mine(addr): if self.wallet.is_change(addr): tf_used_change = True