From f41a8105a130bbbf5816c4e8aa5cdf969e5a3d3d Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 31 Oct 2024 10:13:24 +0100 Subject: [PATCH] normal swaps: do not try to get a refund if we have the preimage. The other party's claim transaction might still be unconfirmed at that point. --- electrum/submarine_swaps.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index 7709abd1e..04fd61652 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -355,6 +355,9 @@ class SwapManager(Logger): if remaining_time > 0: # too early for refund return + if swap.preimage: + # we have been paid. do not try to get refund. + return else: if swap.preimage is None: swap.preimage = self.lnworker.get_preimage(swap.payment_hash)