Browse Source

fix is_complete

master
ThomasV 12 years ago
parent
commit
44edb4e2bb
  1. 2
      gui/qt/main_window.py
  2. 5
      lib/transaction.py

2
gui/qt/main_window.py

@ -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'])

5
lib/transaction.py

@ -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'],

Loading…
Cancel
Save