<p>There is no need to truncate it. You can just start Bitcoin Core with the <code>-reindex</code> option. If you do, it'll throw away the UTXO set and other databases, and rebuild it from the blocks you have on disk (which will be kept), up to the point where they're corrupt. It'll take a while (possibly nearly as long as synchronizing in the first place), but it won't redownload valid blocks you already have.</p>

CC BY-SA 4.0
2021-10-04T21:33:44.183Z
thanks, that makes sense, but it doesn't fit my scenario. When I tried -reindex I would get another error message asking me to to -reindex -- stuck in an infinte loop more or less. So it seems there must be something about the LevelDB corruption that I experienced that prevented -reindex from working. (At that point I used the 'Reset Blockchain' command on myNode which wiped out the entire installation and started the Initial Block Download. That was painful, but better than being stuck in that error loop.) I wonder if there was some other way to deal with the situation...
ckapilla
CC BY-SA 4.0
2021-10-04T21:37:45.120Z
If you're getting repeated errors, your hardware is most likely broken (overheating, memory errors, disk issues, ... Bitcoin fulls nodes tend to stress hardware far more than most applications).
Pieter Wuille
CC BY-SA 4.0
2021-10-04T21:57:51.790Z
I'm hoping it was not permanently broken, but temporarily overheated -- I guess time will tell...
ckapilla
CC BY-SA 4.0
2021-10-04T22:56:22.327Z
Well if you get the problem again after a reindex, it's not a one-time thing.
Pieter Wuille
CC BY-SA 4.0
2021-10-04T21:00:00.640Z
2021-10-04T21:00:00.640Z
Pieter Wuille
<p>After running bitcoind (as part of myNode) for 6 monhths with no issue, I got this error:</p>
<blockquote>
<p>Fatal LevelDB error: Corruption: checksum mismatch:
/home/bitcoin/.bitcoin/indexes/txindex/257701.log</p>
</blockquote>
<p>At that point it would have been great to truncate the blockchain to some previously known good block and start loading blocks from that point (instead of starting from scratch which takes nearly a week). Since the integrity of the blockchain is maintained continuously from the genesis block on, I don't see that there would be any risk (or too great of a difficulty) in doing this. Yet it does not appear that there is any tool available to do such a truncation -- is this simply because no one has bothered to create and release such a tool, or would truncating the blockchain create some security risk that I'm not aware of?</p>

<blockchain><bitcoind>
Why Is it not possible to truncate the blockchain after Corruption detected
ckapilla
# Why Is it not possible to truncate the blockchain after Corruption detected

(Asked by: username_0 on 2021-10-04)

After running bitcoind (as part of myNode) for 6 monhths with no issue, I got this error:

> Fatal LevelDB error: Corruption: checksum mismatch:
> /home/bitcoin/.bitcoin/indexes/txindex/257701.log

At that point it would have been great to truncate the blockchain to some previously known good block and start loading blocks from that point (instead of starting from scratch which takes nearly a week). Since the integrity of the blockchain is maintained continuously from the genesis block on, I don't see that there would be any risk (or too great of a difficulty) in doing this. Yet it does not appear that there is any tool available to do such a truncation -- is this simply because no one has bothered to create and release such a tool, or would truncating the blockchain create some security risk that I'm not aware of?

**Tags:** blockchain, bitcoind


---

## 1 answers

### Answer by username_1 on 2021-10-04. Score: 2

There is no need to truncate it. You can just start Bitcoin Core with the `-reindex` option. If you do, it'll throw away the UTXO set and other databases, and rebuild it from the blocks you have on disk (which will be kept), up to the point where they're corrupt. It'll take a while (possibly nearly as long as synchronizing in the first place), but it won't redownload valid blocks you already have.

> **Comments:**
> **username_0**: thanks, that makes sense, but it doesn't fit my scenario. When I tried -reindex I would get another error message asking me to to -reindex -- stuck in an infinte loop more or less. So it seems there must be something about the LevelDB corruption that I experienced that prevented -reindex from working. (At that point I used the 'Reset Blockchain' command on myNode which wiped out the entire installation and started the Initial Block Download. That was painful, but better than being stuck in that error loop.) I wonder if there was some other way to deal with the situation...  
> **username_1**: If you're getting repeated errors, your hardware is most likely broken (overheating, memory errors, disk issues, ... Bitcoin fulls nodes tend to stress hardware far more than most applications).  
> **username_0**: I'm hoping it was not permanently broken, but temporarily overheated -- I guess time will tell...  
> **username_1**: Well if you get the problem again after a reindex, it's not a one-time thing.  

---

