Threaded decryption

This commit is contained in:
Neil Booth 2016-01-17 21:13:26 +09:00
parent 06c262d0dc
commit ef2c472739
1 changed files with 4 additions and 7 deletions

View File

@ -2126,13 +2126,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
@protected @protected
def do_decrypt(self, message_e, pubkey_e, encrypted_e, password): def do_decrypt(self, message_e, pubkey_e, encrypted_e, password):
try: cyphertext = str(encrypted_e.toPlainText())
decrypted = self.wallet.decrypt_message(str(pubkey_e.text()), str(encrypted_e.toPlainText()), password) task = partial(self.wallet.decrypt_message, str(pubkey_e.text()),
message_e.setText(decrypted) cyphertext, password)
except BaseException as e: self.wallet.thread.add(task, on_success=message_e.setText)
traceback.print_exc(file=sys.stdout)
self.show_warning(str(e))
def do_encrypt(self, message_e, pubkey_e, encrypted_e): def do_encrypt(self, message_e, pubkey_e, encrypted_e):
message = unicode(message_e.toPlainText()) message = unicode(message_e.toPlainText())