commit 76bddb1ec29f89e0141a4973937525bb21be797f
parent 608d8981193ae5f68a3b3b750bd1de9312c5add8
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 25 May 2020 16:35:29 +0200
swaps: handle cancellation in password dialog
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/electrum/gui/qt/swap_dialog.py b/electrum/gui/qt/swap_dialog.py
@@ -184,8 +184,11 @@ class SwapDialog(WindowModalDialog):
if self.is_reverse:
amount_sat = self.send_amount_e.get_amount()
coro = self.swap_manager.reverse_swap(amount_sat)
+ asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop)
else:
amount_sat = self.recv_amount_e.get_amount()
- password = self.window.protect(lambda x: x, [])
- coro = self.swap_manager.normal_swap(amount_sat, password)
+ self.window.protect(self.do_normal_swap, (amount_sat,))
+
+ def do_normal_swap(self, amount_sat, password):
+ coro = self.swap_manager.normal_swap(amount_sat, password)
asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop)