Skip to content

AssertionError when parsing recent blocks #56

Description

@jonatasgrosman

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions