tfix createrawtransaction (issue #574) - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 9d5f39c2353c816327252addd62816e93f348a98 (DIR) parent 2070672ac7478ea6c3f4982fa56a11f481c1f588 (HTM) Author: ThomasV <thomasv@gitorious> Date: Sun, 2 Mar 2014 19:24:44 +0100 fix createrawtransaction (issue #574) Diffstat: M lib/commands.py | 6 ++---- M lib/transaction.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) --- (DIR) diff --git a/lib/commands.py b/lib/commands.py t@@ -160,14 +160,12 @@ class Commands: def createrawtransaction(self, inputs, outputs): - # convert to own format - for i in inputs: - i['tx_hash'] = i['txid'] - i['index'] = i['vout'] + inputs = map(lambda i: {'prevout_hash': i['txid'], 'prevout_n':i['vout']}, inputs ) outputs = map(lambda x: (x[0],int(1e8*x[1])), outputs.items()) tx = Transaction.from_io(inputs, outputs) return tx + def signrawtransaction(self, raw_tx, input_info, private_keys): tx = Transaction(raw_tx) self.wallet.signrawtransaction(tx, input_info, private_keys, self.password) (DIR) diff --git a/lib/transaction.py b/lib/transaction.py t@@ -671,7 +671,7 @@ class Transaction: item = { 'prevout_hash':i['prevout_hash'], 'prevout_n':i['prevout_n'], - 'address':i['address'], + 'address':i.get('address'), 'KeyID':i.get('KeyID'), 'scriptPubKey':i.get('scriptPubKey'), 'redeemScript':i.get('redeemScript'),