This commit is contained in:
ThomasV 2014-05-29 15:30:23 +02:00
parent f9796994f7
commit 16929a40b1

View file

@ -816,6 +816,7 @@ class ElectrumWindow(QMainWindow):
@protected @protected
def send_tx(self, outputs, fee, label, password): def send_tx(self, outputs, fee, label, password):
self.send_button.setDisabled(True)
# first, create an unsigned tx # first, create an unsigned tx
domain = self.get_payment_sources() domain = self.get_payment_sources()
@ -825,6 +826,7 @@ class ElectrumWindow(QMainWindow):
except Exception as e: except Exception as e:
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
self.show_message(str(e)) self.show_message(str(e))
self.send_button.setDisabled(False)
return return
# call hook to see if plugin needs gui interaction # call hook to see if plugin needs gui interaction
@ -841,9 +843,11 @@ class ElectrumWindow(QMainWindow):
def sign_done(tx, fee, label): def sign_done(tx, fee, label):
if tx.error: if tx.error:
self.show_message(tx.error) self.show_message(tx.error)
self.send_button.setDisabled(False)
return return
if tx.requires_fee(self.wallet.verifier) and fee < MIN_RELAY_TX_FEE: if tx.requires_fee(self.wallet.verifier) and fee < MIN_RELAY_TX_FEE:
QMessageBox.warning(self, _('Error'), _("This transaction requires a higher fee, or it will not be propagated by the network."), _('OK')) QMessageBox.warning(self, _('Error'), _("This transaction requires a higher fee, or it will not be propagated by the network."), _('OK'))
self.send_button.setDisabled(False)
return return
if label: if label:
self.wallet.set_label(tx.hash(), label) self.wallet.set_label(tx.hash(), label)
@ -851,6 +855,8 @@ class ElectrumWindow(QMainWindow):
if not self.gui_object.payment_request: if not self.gui_object.payment_request:
if not tx.is_complete() or self.config.get('show_before_broadcast'): if not tx.is_complete() or self.config.get('show_before_broadcast'):
self.show_transaction(tx) self.show_transaction(tx)
self.do_clear()
self.send_button.setDisabled(False)
return return
self.broadcast_transaction(tx) self.broadcast_transaction(tx)
@ -877,6 +883,7 @@ class ElectrumWindow(QMainWindow):
self.do_clear() self.do_clear()
else: else:
QMessageBox.warning(self, _('Error'), msg, _('OK')) QMessageBox.warning(self, _('Error'), msg, _('OK'))
self.send_button.setDisabled(False)
self.waiting_dialog = WaitingDialog(self, 'Broadcasting..', broadcast_thread, broadcast_done) self.waiting_dialog = WaitingDialog(self, 'Broadcasting..', broadcast_thread, broadcast_done)
self.waiting_dialog.start() self.waiting_dialog.start()