From 5d9678a2690abbfbb22dc137f94e51fea28a95fd Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 21 Jan 2023 12:39:13 +0100 Subject: [PATCH] lnworker: extend swap label only if we are still watching the address Without this, old swap transactions for which we have deleted the channel are incorrectly labeled. --- electrum/lnworker.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 2c869f20d..f89c29370 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -936,11 +936,12 @@ class LNWallet(LNWorker): amount_msat = 0 label = 'Reverse swap' if swap.is_reverse else 'Forward swap' delta = current_height - swap.locktime - tx_height = self.wallet.adb.get_tx_height(swap.funding_txid) - if swap.is_reverse and tx_height.height <= 0: - label += ' (%s)' % _('waiting for funding tx confirmation') - if not swap.is_reverse and not swap.is_redeemed and swap.spending_txid is None and delta < 0: - label += f' (refundable in {-delta} blocks)' # fixme: only if unspent + if self.wallet.adb.is_mine(swap.funding_txid): + tx_height = self.wallet.adb.get_tx_height(swap.funding_txid) + if swap.is_reverse and tx_height.height <= 0: + label += ' (%s)' % _('waiting for funding tx confirmation') + if not swap.is_reverse and not swap.is_redeemed and swap.spending_txid is None and delta < 0: + label += f' (refundable in {-delta} blocks)' # fixme: only if unspent out[txid] = { 'txid': txid, 'group_id': txid,