submarine_swaps: consider is_redeemed as sufficient for swap not
to be pending
This commit is contained in:
@@ -1287,6 +1287,11 @@ class SwapManager(Logger):
|
|||||||
"""Returns a list of swaps with unconfirmed funding tx (which require us to stay online)."""
|
"""Returns a list of swaps with unconfirmed funding tx (which require us to stay online)."""
|
||||||
pending_swaps: List[SwapData] = []
|
pending_swaps: List[SwapData] = []
|
||||||
for swap in self.swaps.values():
|
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
|
# 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
|
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
|
spending_height = self.lnworker.wallet.adb.get_tx_height(swap.spending_txid).height
|
||||||
|
|||||||
Reference in New Issue
Block a user