From 581ed1ed26f9a215b090840d83f7791832c25aa3 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 30 Oct 2014 16:36:29 +0100 Subject: [PATCH] separate signtxwithkey and signtxwithwallet, and simplify sign_transaction --- electrum | 3 -- gui/qt/main_window.py | 6 ++-- lib/commands.py | 13 +++++-- lib/transaction.py | 10 +++--- lib/wallet.py | 80 +++++++++++++++++++------------------------ 5 files changed, 53 insertions(+), 59 deletions(-) diff --git a/electrum b/electrum index 5e2507f46..0127bba4e 100755 --- a/electrum +++ b/electrum @@ -375,9 +375,6 @@ if __name__ == '__main__': if len(args) == 1: args.append(prompt_password('Enter PrivateKey (will not echo):', False)) - elif cmd.name == 'signrawtransaction': - args = [cmd, args[1], json.loads(args[2]) if len(args) > 2 else [] ] - elif cmd.name == 'createmultisig': args = [cmd, int(args[1]), json.loads(args[2])] diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index a9ad46c77..c53752ffd 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1113,9 +1113,7 @@ class ElectrumWindow(QMainWindow): def sign_thread(): if self.wallet.is_watching_only(): return tx - keypairs = {} - self.wallet.add_keypairs(tx, keypairs, password) - self.wallet.sign_transaction(tx, keypairs, password) + self.wallet.sign_transaction(tx, password) return tx def sign_done(tx): @@ -2179,7 +2177,7 @@ class ElectrumWindow(QMainWindow): @protected def sign_raw_transaction(self, tx, password): try: - self.wallet.signrawtransaction(tx, [], password) + self.wallet.sign_transaction(tx, password) except Exception as e: traceback.print_exc(file=sys.stdout) QMessageBox.warning(self, _("Error"), str(e)) diff --git a/lib/commands.py b/lib/commands.py index b6b98aa99..1e39e095c 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -97,7 +97,8 @@ register_command('restore', 0, 0, True, True, False, 'Restore a w register_command('setconfig', 2, 2, False, False, False, 'Set a configuration variable', 'setconfig ') register_command('setlabel', 2,-1, False, True, False, 'Assign a label to an item', 'setlabel