1
0

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

This commit is contained in:
Sander van Grieken
2023-03-10 15:27:39 +01:00
parent a595102d5f
commit 7e5ebf0484

View File

@@ -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