1
0

Have transaction_dialog use send_tx()

This is working towards showing transactions before asking for passwords.
I think it also means the transaction dialog now interacts properly with
plugins, whereas it didn't before.

send_tx now takes a callback instead of a label, and does not decide
on whether to broadast itself; that is left to its caller.

broadcast_transaction() takes care of adding the description of the
successfully broadcast transaction to the wallet.  Previously labels
could be added to the wallet even if the broadcast was cancelled by
the user or unsuccessful, which doesn't seem right.

Lengthen the dialog messages a little, as some window managers lose the
"Please Wait" title bar owing to window decorations if the message
is too short.
This commit is contained in:
Neil Booth
2015-06-03 14:24:15 +09:00
parent f02c2fde64
commit 4b092628df
2 changed files with 33 additions and 31 deletions

View File

@@ -103,7 +103,7 @@ class TxDialog(QWidget):
self.update()
def do_broadcast(self):
self.parent.broadcast_transaction(self.tx)
self.parent.broadcast_transaction(self.tx, None)
self.saved = True
def close(self):
@@ -124,9 +124,11 @@ class TxDialog(QWidget):
def sign(self):
self.parent.sign_raw_transaction(self.tx)
self.update()
def sign_done(success):
self.sign_button.setDisabled(False)
self.update()
self.sign_button.setDisabled(True)
self.parent.send_tx(self.tx, sign_done)
def save(self):
name = 'signed_%s.txn' % (self.tx.hash()[0:8]) if self.tx.is_complete() else 'unsigned.txn'