<p>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.</p>

<p>To do so, first stop Bitcoin Core. Then go to the Bitcoin Core data directory and then the <code>blocks</code> folder within that. Delete the highest numbered <code>blk*.dat</code> and <code>rev*.dat</code> 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.</p>

CC BY-SA 4.0
2023-06-27T00:35:26.933Z
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
CC BY-SA 3.0
2018-02-02T16:53:23.037Z
2018-02-02T16:53:23.037Z
Ava Chow
<p>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 <strong>debug.log</strong> I can see the issue is the next <a href="https://blockchain.info/block/0000000000000000159e7d66c954312bccb5f12de808f2991b3859205665c442" rel="nofollow noreferrer">block #338819</a> being deemed invalid. Here is an excerpt from debug.log demonstrating that:</p>

<pre><code>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
</code></pre>

<p>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).</p>

<p>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?</p>

<bitcoin-core><synchronization><validation><block>
Block #338819 deemed invalid by v0.15.1
Assaf Shomer
# Block #338819 deemed invalid by v0.15.1

(Asked by: username_0 on 2018-02-02)

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](https://blockchain.info/block/0000000000000000159e7d66c954312bccb5f12de808f2991b3859205665c442) 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?

**Tags:** bitcoin-core, synchronization, validation, block


---

## 1 answers

### Answer by username_1 on 2018-02-02. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_2**: 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.  

---

