1

When writing a blockchain parser I've found that some blk00*.dat files contain zeros instead of blocks. (I got zero where magic bytes were expected, looked in the file and saw there are more zeros.)

What does it mean? Do I have corrupted chain? How do I fix my parser, so it would interpret the file correctly?

1

zero instead of magic bytes means the end of bictoin block data. just skip the rest of file and follow to next blk-file

by the way. it is better to assemble blk-files for future parsing with old clients (I use 0.8.5) because they put blocks in right order

  • I've checked that the block in the next file points to hash of previous one and indeed, it does. Thank you! – Martin Habovštiak Sep 6 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.