PyBC icon indicating copy to clipboard operation
PyBC copied to clipboard

Does not work if transactions are more that one

Open alex37529 opened this issue 7 years ago • 1 comments

blk01300.dat 0%| | 0/134037112 [00:00<?, ?it/s] Read block 0 Hash: 0000000000000000001855711df4190b0bdf83e2250de2751c8e7f019a2a8e15 Beginning at: 0 magic: f9beb4d9 block_size: 1245378 version: 00000020 prevHash: 0000000000000000000f4cc5f6aaf9caeb51cfd37b6bef5ca5fc6112ef74d7bf merkle_root: 331fab183319639071ec276ac7eb1c1afbdd6b0682bc3e43a4c8003ca6dd3922 timestamp: 1530247453: 2018-06-29 07:44:13 nBits: 389508950 nonce: 1291371090 n transactions: 1972 Traceback (most recent call last): File "1.py", line 11, in dat.read_all() File "/mnt/soft/PyBC/pybit/py3/chain.py", line 370, in read_all d.read_all() File "/mnt/soft/PyBC/pybit/py3/chain.py", line 178, in read_all self.read_next_block(tqdm_on=False) File "/mnt/soft/PyBC/pybit/py3/chain.py", line 151, in read_next_block b.read_block() File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/block.py", line 138, in read_block File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/block.py", line 291, in read_trans File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/block.py", line 574, in get_transaction File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/block.py", line 498, in _print File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/block.py", line 476, in str File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/common.py", line 197, in hash File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/common.py", line 189, in _hash File "/usr/local/lib/python3.6/dist-packages/pybit-0.1.0-py3.6.egg/pybit/py3/block.py", line 669, in prep_header IndexError: list index out of range

alex37529 avatar Jan 19 '19 12:01 alex37529

Hi Alex,

Thanks for raising this issue. There are a few outstanding things to do with parsing transactions, and general a problem with paring CVarInts that might be the cause, although I'm not sure what's specifically the cause here.

Looking at the name of the .blk you're loading, I haven't tried this one so probably haven't parsed this block before. Do you know if these's anything particularly unusual about it?

garethjns avatar Feb 11 '19 19:02 garethjns