Browse Source

submarine swaps: do not set attempts parameter in pay_invoice

there is no reason to handle that differently.
master
ThomasV 2 years ago
parent
commit
b563c9dd0e
  1. 2
      electrum/lnworker.py
  2. 4
      electrum/submarine_swaps.py

2
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]]:

4
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

Loading…
Cancel
Save