1
0

submarine_swaps: consider is_redeemed as sufficient for swap not

to be pending
This commit is contained in:
ThomasV
2025-05-26 19:44:49 +02:00
parent 0689a7274f
commit f842ce0737

View File

@@ -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