Browse Source

swap: wrap coros in tasks (req since python3.11)

master
Sander van Grieken 3 years ago
parent
commit
7e5ebf0484
  1. 2
      electrum/submarine_swaps.py

2
electrum/submarine_swaps.py

@ -453,7 +453,7 @@ class SwapManager(Logger):
while swap.spending_txid is None:
await asyncio.sleep(1)
# initiate main payment
tasks = [self.lnworker.pay_invoice(invoice, attempts=10, channels=channels), wait_for_funding(swap)]
tasks = [asyncio.create_task(self.lnworker.pay_invoice(invoice, attempts=10, channels=channels)), asyncio.create_task(wait_for_funding(swap))]
await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
success = swap.spending_txid is not None
return success

Loading…
Cancel
Save