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

blockchain.get_ordered_blocks() does not iterate all blocks

Open ManuelSchneid3r opened this issue 2 years ago • 2 comments

When I iterate the blockchain the loop over the blocks above finishes at block 478560/774513. I have no clue why

for block in blockchain.get_ordered_blocks(index=index, cache=cache_file):
    print("\rblk %d/%d" % (block.height, len(blockchain.blockIndexes)), end='')
print("\nBye")

ends with exit_success (0)

0 ms blk 478560/774513
Bye

ManuelSchneid3r avatar Mar 23 '23 08:03 ManuelSchneid3r

For blk 478561 blkIdx.file is -1. Therefore the loop breaks.

How can I debug further?

ManuelSchneid3r avatar Mar 24 '23 17:03 ManuelSchneid3r

Have you tried removing the cache file? Maybe it’s corrupted somehow.

alecalve avatar Mar 23 '24 15:03 alecalve