From b563c9dd0e2fa3293ca7ca649f0747c6458f8d37 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 18 Jan 2024 12:38:10 +0100 Subject: [PATCH] submarine swaps: do not set attempts parameter in pay_invoice there is no reason to handle that differently. --- electrum/lnworker.py | 2 +- electrum/submarine_swaps.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index d0b034808..adee95059 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -1474,7 +1474,7 @@ class LNWallet(LNWorker): async def pay_invoice( self, invoice: str, *, amount_msat: int = None, - attempts: int = None, # used only in unit tests (and for swaps?!) + attempts: int = None, # used only in unit tests full_path: LNPaymentPath = None, channels: Optional[Sequence[Channel]] = None, ) -> Tuple[bool, List[HtlcLog]]: diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index e8a861fe2..c7c37df29 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -835,13 +835,13 @@ class SwapManager(Logger): lightning_amount_sat=lightning_amount_sat) # initiate fee payment. if fee_invoice: - asyncio.ensure_future(self.lnworker.pay_invoice(fee_invoice, attempts=10)) + asyncio.ensure_future(self.lnworker.pay_invoice(fee_invoice)) # we return if we detect funding async def wait_for_funding(swap): while swap.funding_txid is None: await asyncio.sleep(1) # initiate main payment - tasks = [asyncio.create_task(self.lnworker.pay_invoice(invoice, attempts=10, channels=channels)), asyncio.create_task(wait_for_funding(swap))] + tasks = [asyncio.create_task(self.lnworker.pay_invoice(invoice, channels=channels)), asyncio.create_task(wait_for_funding(swap))] await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED) return swap.funding_txid