diff --git a/lbry/lbry/wallet/__init__.py b/lbry/lbry/wallet/__init__.py index 5bda0326ee..443924889f 100644 --- a/lbry/lbry/wallet/__init__.py +++ b/lbry/lbry/wallet/__init__.py @@ -3,6 +3,7 @@ __node_bin__ = '' __node_url__ = ( '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' diff --git a/torba/torba/client/basetransaction.py b/torba/torba/client/basetransaction.py index e54d5e5095..3b47614018 100644 --- a/torba/torba/client/basetransaction.py +++ b/torba/torba/client/basetransaction.py @@ -425,6 +425,10 @@ def _deserialize(self): 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 @@ def _deserialize(self): 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 diff --git a/torba/torba/server/tx.py b/torba/torba/server/tx.py index 0074a05864..e240bef36d 100644 --- a/torba/torba/server/tx.py +++ b/torba/torba/server/tx.py @@ -101,14 +101,26 @@ def __init__(self, binary, start=0): self.binary = binary self.binary_length = len(binary) self.cursor = start + self.flags = 0 def read_tx(self): """Return a deserialized transaction.""" + version = self._read_le_int32() + inputs = self._read_inputs() + outputs = self._read_outputs() + if self.flags == 1: + # drain witness portion of transaction + # too many witnesses for no crime + for i in range(len(inputs)): + for v in range(self._read_varint()): + self._read_varbytes() + self.flags = 0 + locktime = self._read_le_uint32() return Tx( - self._read_le_int32(), # version - self._read_inputs(), # inputs - self._read_outputs(), # outputs - self._read_le_uint32() # locktime + version, + inputs, + outputs, + locktime ) def read_tx_and_hash(self): @@ -132,7 +144,11 @@ def read_tx_block(self): def _read_inputs(self): read_input = self._read_input - return [read_input() for i in range(self._read_varint())] + num_inputs = self._read_varint() + if num_inputs == 0: + self.flags = self._read_byte() + num_inputs = self._read_varint() + return [read_input() for i in range(num_inputs)] def _read_input(self): return TxInput(