From f842ce073730028f8f8efbaf20bcb7d88c07b12a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 26 May 2025 19:44:49 +0200 Subject: [PATCH] submarine_swaps: consider is_redeemed as sufficient for swap not to be pending --- electrum/submarine_swaps.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index 47d2cbffe..316299023 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -1287,6 +1287,11 @@ class SwapManager(Logger): """Returns a list of swaps with unconfirmed funding tx (which require us to stay online).""" pending_swaps: List[SwapData] = [] for swap in self.swaps.values(): + if swap.is_redeemed: + # adb data might have been removed after is_redeemed was set. + # in that case lnwatcher will no longer fetch the spending tx + # and adb will return TX_HEIGHT_LOCAL + continue # note: adb.get_tx_height returns TX_HEIGHT_LOCAL if the txid is unknown funding_height = self.lnworker.wallet.adb.get_tx_height(swap.funding_txid).height spending_height = self.lnworker.wallet.adb.get_tx_height(swap.spending_txid).height