tsign_tx hook - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 2b0d92e767396d12d7b69d2fe85477d8c38fb945 DIR parent 401c24e4ad3dfa99c2e985ba7270807664be7838 HTML Author: ThomasV <thomasv@gitorious> Date: Sun, 29 Sep 2013 10:16:17 +0200 sign_tx hook Diffstat: M gui/qt/main_window.py | 2 -- M lib/wallet.py | 10 +++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) --- DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -904,8 +904,6 @@ class ElectrumWindow(QMainWindow): QMessageBox.warning(self, _('Error'), _("This transaction requires a higher fee, or it will not be propagated by the network."), _('OK')) return - run_hook('send_tx', tx) - if label: self.set_label(tx.hash(), label) DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -34,6 +34,7 @@ from util import print_msg, print_error, format_satoshis from bitcoin import * from account import * from transaction import Transaction +from plugins import run_hook # AES encryption EncodeAES = lambda secret, s: base64.b64encode(aes.encryptData(secret,s)) t@@ -652,7 +653,8 @@ class Wallet: print txin - tx.sign( keypairs ) + self.sign_tx(tx, keypairs) + def sign_message(self, address, message, password): keys = self.get_private_key(address, password) t@@ -1217,7 +1219,13 @@ class Wallet: for sec in private_keys: pubkey = public_key_from_private_key(sec) keypairs[ pubkey ] = sec + + self.sign_tx(tx, keypairs) + + + def sign_tx(self, tx, keypairs): tx.sign(keypairs) + run_hook('sign_tx', tx) def sendtx(self, tx):