From ef2c472739c16e90cf9d2dca11b0627f0694c3c7 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 17 Jan 2016 21:13:26 +0900 Subject: [PATCH] Threaded decryption --- gui/qt/main_window.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 6e6673b40..5cbebe95e 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2126,13 +2126,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): @protected def do_decrypt(self, message_e, pubkey_e, encrypted_e, password): - try: - decrypted = self.wallet.decrypt_message(str(pubkey_e.text()), str(encrypted_e.toPlainText()), password) - message_e.setText(decrypted) - except BaseException as e: - traceback.print_exc(file=sys.stdout) - self.show_warning(str(e)) - + cyphertext = str(encrypted_e.toPlainText()) + task = partial(self.wallet.decrypt_message, str(pubkey_e.text()), + cyphertext, password) + self.wallet.thread.add(task, on_success=message_e.setText) def do_encrypt(self, message_e, pubkey_e, encrypted_e): message = unicode(message_e.toPlainText())