Browse Source

Rename send_tx() to sign_tx()

Because it signs, and it doesn't send.
283
Neil Booth 10 years ago
parent
commit
15632adb40
  1. 6
      gui/qt/main_window.py
  2. 2
      gui/qt/transaction_dialog.py
  3. 3
      plugins/btchipwallet.py
  4. 4
      plugins/trustedcoin.py

6
gui/qt/main_window.py

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

2
gui/qt/transaction_dialog.py

@ -145,7 +145,7 @@ class TxDialog(QWidget):
self.prompt_if_unsaved = True self.prompt_if_unsaved = True
self.saved = False self.saved = False
self.update() self.update()
self.parent.send_tx(self.tx, sign_done) self.parent.sign_tx(self.tx, sign_done)
def save(self): def save(self):
name = 'signed_%s.txn' % (self.tx.hash()[0:8]) if self.tx.is_complete() else 'unsigned.txn' name = 'signed_%s.txn' % (self.tx.hash()[0:8]) if self.tx.is_complete() else 'unsigned.txn'

3
plugins/btchipwallet.py

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

4
plugins/trustedcoin.py

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

Loading…
Cancel
Save