3

I am attempting to sync from scratch a full node (v0.15.1) on a linux machine (Linux Mint running Ubuntu precise 12.04.1 LTS). The sync grinds to a halt on block #338818. From examining debug.log I can see the issue is the next block #338819 being deemed invalid. Here is an excerpt from debug.log demonstrating that:

2018-02-02 16:36:52 ERROR: AcceptBlockHeader: block 0000000000000000159e7d66c954312bccb5f12de808f2991b3859205665c442 is marked invalid
2018-02-02 16:36:52 ERROR: invalid header received
2018-02-02 16:36:52 ProcessMessages(headers, 162003 bytes) FAILED peer=217

bitcoin-qt continues to ask peers for the block header and keeps rejecting it as invalid, even though this block seems to be valid as part of the main chain, at least according to all known nodes that I checked (e.g. blockchain.info, blocktrail and several others).

I googled for this block # and found nothing, so I assume nobody else has this problem. What is going on? What should I do to continue with the sync?

1 Answer 1

2

That error means that the block got corrupted somewhere so it became invalid. The only way to fix this is to re-download the block.

To do so, first stop Bitcoin Core. Then go to the Bitcoin Core data directory and then the blocks folder within that. Delete the highest numbered blk*.dat and rev*.dat files. Then start Bitcoin Core again. When it asks whether you want to reindex the databases, choose yes. Bitcoin Core will now rebuild the block indexes and then continue with syncing once it is done. Note that while it is reindexing, it will look like it is syncing the blockchain again, but it is not. It is using the data on disk to build the block index and chain state until it needs to download blocks again to continue syncing.

1
  • I had this same issue in Litecoin with LitecoinCore: 0.21.2.2. I tried removing those files as suggested in this answer but didn't work (gave an error and the app closed). Instead I put the files back and just started litecoin with the -reindex (single dash for the option on Windows as least). This took several hours (6+?) but in the end the issue went away.
    – User
    Commented Jun 27, 2023 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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