fix is_complete
This commit is contained in:
@@ -1658,7 +1658,7 @@ class ElectrumWindow(QMainWindow):
|
|||||||
tx_dict = json.loads(str(txt))
|
tx_dict = json.loads(str(txt))
|
||||||
assert "hex" in tx_dict.keys()
|
assert "hex" in tx_dict.keys()
|
||||||
assert "complete" 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"]:
|
if not tx_dict["complete"]:
|
||||||
assert "input_info" in tx_dict.keys()
|
assert "input_info" in tx_dict.keys()
|
||||||
input_info = json.loads(tx_dict['input_info'])
|
input_info = json.loads(tx_dict['input_info'])
|
||||||
|
|||||||
@@ -370,13 +370,13 @@ def get_address_from_output_script(bytes):
|
|||||||
|
|
||||||
class Transaction:
|
class Transaction:
|
||||||
|
|
||||||
def __init__(self, raw):
|
def __init__(self, raw, is_complete = True):
|
||||||
self.raw = raw
|
self.raw = raw
|
||||||
self.deserialize()
|
self.deserialize()
|
||||||
self.inputs = self.d['inputs']
|
self.inputs = self.d['inputs']
|
||||||
self.outputs = self.d['outputs']
|
self.outputs = self.d['outputs']
|
||||||
self.outputs = map(lambda x: (x['address'],x['value']), self.outputs)
|
self.outputs = map(lambda x: (x['address'],x['value']), self.outputs)
|
||||||
self.is_complete = False
|
self.is_complete = is_complete
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.raw
|
return self.raw
|
||||||
@@ -666,7 +666,6 @@ class Transaction:
|
|||||||
def get_input_info(self):
|
def get_input_info(self):
|
||||||
info = []
|
info = []
|
||||||
for i in self.inputs:
|
for i in self.inputs:
|
||||||
print len(i)
|
|
||||||
item = {
|
item = {
|
||||||
'prevout_hash':i['prevout_hash'],
|
'prevout_hash':i['prevout_hash'],
|
||||||
'prevout_n':i['prevout_n'],
|
'prevout_n':i['prevout_n'],
|
||||||
|
|||||||
Reference in New Issue
Block a user