Rename send_tx() to sign_tx()

Because it signs, and it doesn't send.
This commit is contained in:
Neil Booth 2015-07-04 16:45:08 +09:00
parent b2bfd5af1f
commit 15632adb40
4 changed files with 69 additions and 70 deletions

View File

@ -1137,18 +1137,18 @@ class ElectrumWindow(QMainWindow):
self.do_clear()
else:
self.broadcast_transaction(tx, tx_desc)
self.send_tx(tx, sign_done)
self.sign_tx(tx, sign_done)
@protected
def send_tx(self, tx, callback, password):
def sign_tx(self, tx, callback, password):
'''Sign the transaction in a separate thread. When done, calls
the callback with a success code of True or False.
'''
self.send_button.setDisabled(True)
# call hook to see if plugin needs gui interaction
run_hook('send_tx', tx)
run_hook('sign_tx', tx)
# sign the tx
success = [False] # Array to work around python scoping

View File

@ -145,7 +145,7 @@ class TxDialog(QWidget):
self.prompt_if_unsaved = True
self.saved = False
self.update()
self.parent.send_tx(self.tx, sign_done)
self.parent.sign_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'

View File

@ -96,7 +96,7 @@ class Plugin(BasePlugin):
return wallet
@hook
def send_tx(self, tx):
def sign_tx(self, tx):
tx.error = None
try:
self.wallet.sign_transaction(tx, None)
@ -525,4 +525,3 @@ if BTCHIP:
def waitFirstResponse(self, timeout):
return self.dongle.waitFirstResponse(timeout)

View File

@ -444,8 +444,8 @@ class Plugin(BasePlugin):
return False
@hook
def send_tx(self, tx):
self.print_error("twofactor:send_tx")
def sign_tx(self, tx):
self.print_error("twofactor:sign_tx")
if self.wallet.storage.get('wallet_type') != '2fa':
return