From cb907c90f9668361298d4ea8b425aa21a845943c Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 6 Aug 2023 11:37:26 +0200 Subject: [PATCH] submarine swaps: set prepay_hash for normal swaps. This fixes the group_id of fee prepayment transactions for the server --- electrum/submarine_swaps.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index bd4074dcb..5d40a72fb 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -155,7 +155,7 @@ class SwapManager(Logger): self.prepayments = {} # type: Dict[bytes, bytes] # fee_rhash -> rhash for k, swap in self.swaps.items(): - if swap.is_reverse and swap.prepay_hash is not None: + if swap.prepay_hash is not None: self.prepayments[swap.prepay_hash] = bytes.fromhex(k) # api url self.api_url = wallet.config.get_swapserver_url() @@ -328,6 +328,7 @@ class SwapManager(Logger): ) self.wallet.save_invoice(Invoice.from_bech32(invoice)) prepay_invoice = None + prepay_hash = None else: onchain_amount_sat = self._get_recv_amount(lightning_amount_sat, is_reverse=True) prepay_amount_sat = self.get_claim_fee() * 2 @@ -364,7 +365,7 @@ class SwapManager(Logger): locktime = locktime, privkey = privkey, preimage = None, - prepay_hash = None, + prepay_hash = prepay_hash, lockup_address = lockup_address, onchain_amount = onchain_amount_sat, receive_address = receive_address,