python-bitcoin-blockchain-parser icon indicating copy to clipboard operation
python-bitcoin-blockchain-parser copied to clipboard

AssertionError when parsing recent blocks

Open jonatasgrosman opened this issue 7 years ago • 1 comments

The parser is working properly with old blk files, but with recent blk files throws this error:

File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/block.py", line 81, in transactions
    self._transactions = list(get_block_transactions(self.hex))
  File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/block.py", line 29, in get_block_transactions
    transaction = Transaction.from_hex(transaction_data[offset:])
  File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/transaction.py", line 60, in from_hex
    return cls(hex)
  File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/transaction.py", line 39, in __init__
    input = Input.from_hex(raw_hex[offset:])
  File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/input.py", line 33, in from_hex
    return cls(hex_)
  File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/input.py", line 25, in __init__
    self._script_length, varint_length = decode_varint(raw_hex[36:])
  File "/usr/local/lib/python3.5/dist-packages/blockchain_parser/utils.py", line 50, in decode_varint
    assert(len(data) > 0)
AssertionError

... this is a log when use blk01347.dat file

jonatasgrosman avatar Aug 18 '18 22:08 jonatasgrosman

which is the last block to be correctly parsed? Does it still occur using 0.1.5?

alecalve avatar Sep 18 '20 15:09 alecalve