From 73085877ddd1cf651a6e544b44ac2295a98f2c8a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 11 Nov 2014 10:30:19 +0100 Subject: [PATCH] bugfix: don't call GUI in non-GUI thread --- gui/qt/main_window.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index b0c49353..e656b0a2 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1134,32 +1134,30 @@ class ElectrumWindow(QMainWindow): def broadcast_transaction(self, tx): def broadcast_thread(): + # non-GUI thread pr = self.payment_request if pr is None: return self.wallet.sendtx(tx) - if pr.has_expired(): self.payment_request = None return False, _("Payment request has expired") - status, msg = self.wallet.sendtx(tx) if not status: return False, msg - self.invoices[pr.get_id()] = (pr.get_domain(), pr.get_memo(), pr.get_amount(), pr.get_expiration_date(), PR_PAID, tx.hash()) self.wallet.storage.put('invoices', self.invoices) - self.update_invoices_tab() self.payment_request = None refund_address = self.wallet.addresses()[0] ack_status, ack_msg = pr.send_ack(str(tx), refund_address) if ack_status: msg = ack_msg - return status, msg def broadcast_done(status, msg): + # GUI thread if status: QMessageBox.information(self, '', _('Payment sent.') + '\n' + msg, _('OK')) + self.update_invoices_tab() self.do_clear() else: QMessageBox.warning(self, _('Error'), msg, _('OK'))