rename inpust_info -> input_info
authorthomasv <thomasv@gitorious>
Mon, 25 Feb 2013 08:34:47 +0000 (09:34 +0100)
committerthomasv <thomasv@gitorious>
Mon, 25 Feb 2013 08:34:47 +0000 (09:34 +0100)
electrum
lib/bitcoin.py
lib/wallet.py

index 4fc1b21..07c9ed8 100755 (executable)
--- a/electrum
+++ b/electrum
@@ -639,7 +639,7 @@ if __name__ == '__main__':
             out = {"hex":str(tx), "complete":tx.is_complete}
             if not tx.is_complete: 
                 import json
-                out['input_info'] = repr(tx.inputs_info).replace(' ','')
+                out['input_info'] = repr(tx.input_info).replace(' ','')
             print_json(out)
 
         if is_temporary:
@@ -736,8 +736,8 @@ if __name__ == '__main__':
 
     elif cmd == 'signrawtransaction':
         tx = Transaction(args[1])
-        inputs_info = ast.literal_eval(args[2]) if len(args)>2 else []
-        private_keys = ast.literal_eval(args[3]) if len(args)>3 else {}
+        input_info = ast.literal_eval(args[2]) if len(args)>2 else []
+        private_keys = ast.literal_eval(args[3]) if len(args)>3 else []
         unspent_coins = wallet.get_unspent_coins()
 
         # convert private_keys to dict 
@@ -752,7 +752,7 @@ if __name__ == '__main__':
             txin['tx_hash'] = txin['prevout_hash']
             txin['index'] = txin['prevout_n']
 
-            for item in inputs_info:
+            for item in input_info:
                 if item.get('txid') == txin['tx_hash'] and item.get('vout') == txin['index']:
                     txin['raw_output_script'] = item['scriptPubKey']
                     txin['redeemScript'] = item.get('redeemScript')
@@ -777,7 +777,7 @@ if __name__ == '__main__':
                 private_keys[address] = sec
 
             elif txin.get("redeemScript"):
-                txin['address'] = hash_160_to_bc_address(hash_160(txin.get("redeemScript").decode('hex')), 5)
+                txin['address'] = bitcoin.hash_160_to_bc_address(bitcoin.hash_160(txin.get("redeemScript").decode('hex')), 5)
 
             elif txin.get("raw_output_script"):
                 addr = deserialize.get_address_from_output_script(txin.get("raw_output_script").decode('hex'))
index a7b6a02..150faed 100644 (file)
@@ -484,7 +484,7 @@ class Transaction:
             print i
             e = { 'txid':i['tx_hash'], 'vout':i['index'],'scriptPubKey':i['raw_output_script'] }
             extras.append(e)
-        self.inputs_info = extras
+        self.input_info = extras
         return self
 
     def __str__(self):
index b3599ae..865c6b5 100644 (file)
@@ -672,7 +672,7 @@ class Wallet:
         for i in range(len(tx.inputs)):
             addr = tx.inputs[i]['address']
             n, is_change = self.get_address_index(addr)
-            tx.inputs_info[i]['electrumKeyID'] = (n, is_change)
+            tx.input_info[i]['electrumKeyID'] = (n, is_change)
 
         if not self.seed:
             return tx