added witness transaction parsing to torba parser

This commit is contained in:
Lex Berezhny 2019-11-11 16:31:23 -05:00
parent bb6ef42d0c
commit 0f2a0b7c97
2 changed files with 12 additions and 1 deletions

View file

@ -2,7 +2,8 @@ __node_daemon__ = 'lbrycrdd'
__node_cli__ = 'lbrycrd-cli'
__node_bin__ = ''
__node_url__ = (
'https://github.com/lbryio/lbrycrd/releases/download/v0.17.3.1/lbrycrd-linux-1731.zip'
'https://github.com/lbryio/lbrycrd/releases/download/v0.17.2.1/lbrycrd-linux.zip'
# 'https://github.com/lbryio/lbrycrd/releases/download/v0.17.3.1/lbrycrd-linux-1731.zip'
)
__spvserver__ = 'lbry.wallet.server.coin.LBCRegTest'

View file

@ -425,6 +425,10 @@ class BaseTransaction:
stream = BCDataStream(self._raw)
self.version = stream.read_uint32()
input_count = stream.read_compact_size()
flag = 0
if input_count == 0:
flag = stream.read_uint8()
input_count = stream.read_compact_size()
self._add(self._inputs, [
self.input_class.deserialize_from(stream) for _ in range(input_count)
])
@ -432,6 +436,12 @@ class BaseTransaction:
self._add(self._outputs, [
self.output_class.deserialize_from(stream) for _ in range(output_count)
])
if flag == 1:
# drain witness portion of transaction
# too many witnesses for no crime
for _ in range(input_count):
for _ in range(stream.read_compact_size()):
stream.read(stream.read_compact_size())
self.locktime = stream.read_uint32()
@classmethod