fix #3014
This commit is contained in:
parent
e0635f5d08
commit
c72123d708
@ -429,6 +429,8 @@ def parse_input(vds):
|
|||||||
def parse_witness(vds, txin):
|
def parse_witness(vds, txin):
|
||||||
n = vds.read_compact_size()
|
n = vds.read_compact_size()
|
||||||
if n == 0:
|
if n == 0:
|
||||||
|
return
|
||||||
|
if n == 0xffffffff:
|
||||||
txin['value'] = vds.read_uint64()
|
txin['value'] = vds.read_uint64()
|
||||||
n = vds.read_compact_size()
|
n = vds.read_compact_size()
|
||||||
w = list(bh2u(vds.read_bytes(vds.read_compact_size())) for i in range(n))
|
w = list(bh2u(vds.read_bytes(vds.read_compact_size())) for i in range(n))
|
||||||
@ -644,7 +646,7 @@ class Transaction:
|
|||||||
witness = var_int(n) + '00' + ''.join(var_int(len(x)//2) + x for x in sig_list) + var_int(len(witness_script)//2) + witness_script
|
witness = var_int(n) + '00' + ''.join(var_int(len(x)//2) + x for x in sig_list) + var_int(len(witness_script)//2) + witness_script
|
||||||
else:
|
else:
|
||||||
raise BaseException('wrong txin type')
|
raise BaseException('wrong txin type')
|
||||||
value_field = '' if self.is_txin_complete(txin) else var_int(0) + int_to_hex(txin['value'], 8)
|
value_field = '' if self.is_txin_complete(txin) else var_int(0xffffffff) + int_to_hex(txin['value'], 8)
|
||||||
return value_field + witness
|
return value_field + witness
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user