fix is_complete
authorThomasV <thomasv@gitorious>
Sun, 29 Sep 2013 13:34:24 +0000 (15:34 +0200)
committerThomasV <thomasv@gitorious>
Sun, 29 Sep 2013 13:34:24 +0000 (15:34 +0200)
gui/qt/main_window.py
lib/transaction.py

index 511c032..e348344 100644 (file)
@@ -1658,7 +1658,7 @@ class ElectrumWindow(QMainWindow):
             tx_dict = json.loads(str(txt))
             assert "hex" in tx_dict.keys()
             assert "complete" in tx_dict.keys()
-            tx = Transaction(tx_dict["hex"])
+            tx = Transaction(tx_dict["hex"], tx_dict["complete"])
             if not tx_dict["complete"]:
                 assert "input_info" in tx_dict.keys()
                 input_info = json.loads(tx_dict['input_info'])
index 7f16ac1..73ddd7b 100644 (file)
@@ -370,13 +370,13 @@ def get_address_from_output_script(bytes):
 
 class Transaction:
     
-    def __init__(self, raw):
+    def __init__(self, raw, is_complete = True):
         self.raw = raw
         self.deserialize()
         self.inputs = self.d['inputs']
         self.outputs = self.d['outputs']
         self.outputs = map(lambda x: (x['address'],x['value']), self.outputs)
-        self.is_complete = False
+        self.is_complete = is_complete
         
     def __str__(self):
         return self.raw
@@ -666,7 +666,6 @@ class Transaction:
     def get_input_info(self):
         info = []
         for i in self.inputs:
-            print len(i)
             item = { 
                 'prevout_hash':i['prevout_hash'], 
                 'prevout_n':i['prevout_n'],