<p><code>-rescan</code> likely did nothing at all. It goes through the blockchain to find transactions that are missing from your wallet. It is only very rarely needed (like when you manually changed things in wallet.dat).</p>

<p><code>-reindex</code> throws away the block chain index and chain state (the database of all unspent transaction outputs), and rebuilds those from scratch. It is exactly like downloading the block chain again from peers, except the blocks already on disk are used.</p>

CC BY-SA 4.0
2019-03-22T22:50:47.447Z
Does `-reindex` fix corrupted blk files? Say I deleted a random one, will that get downloaded in the process, without having to download the full blockchain?
Giszmo
CC BY-SA 4.0
2019-03-22T23:02:17.197Z
Is `-assumevalid=0` making sure my blk files are getting verified when running a `-reindex`?
Giszmo
CC BY-SA 4.0
2019-11-16T18:24:11.607Z
`-reindex` does not fix corrupted files, but it will detect missing or corrupted ones. In that case the normal block download process from network will start over wherever things went wrong.
Pieter Wuille
CC BY-SA 4.0
2019-11-16T18:25:04.450Z
`-assumevalid=0` only changes whether historical scripts are validated or not (both during normal validation and during reindex). Without it, everything except scripts is still validated.
Pieter Wuille
CC BY-SA 3.0
2014-02-15T16:38:13.460Z
2015-10-11T17:26:34.580Z
2015-10-11T17:26:34.580Z
Pieter Wuille
<p>I spent a ton of time today trying to get Bitcoin-Qt to sync using the bootstrap.dat file and could not get it to work.  I found an answer on this forum saying to use:
<code>/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -rescan -reindex</code></p>

<p>Which seems to have worked perfectly.  Now I'm just wondering what exactly that command did to fix the problem?</p>

<bitcoin-core><bootstrap.dat><rescan><reindex>
What exactly did `Bitcoin-Qt -rescan -reindex` do?
Derek Kaknes
# What exactly did `Bitcoin-Qt -rescan -reindex` do?

(Asked by: username_0 on 2014-02-15)

I spent a ton of time today trying to get Bitcoin-Qt to sync using the bootstrap.dat file and could not get it to work. I found an answer on this forum saying to use:
`/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -rescan -reindex`

Which seems to have worked perfectly. Now I'm just wondering what exactly that command did to fix the problem?

**Tags:** bitcoin-core, bootstrap.dat, rescan, reindex


---

## 1 answers

### Answer by username_1 on 2014-02-15. Score: 21

`-rescan` likely did nothing at all. It goes through the blockchain to find transactions that are missing from your wallet. It is only very rarely needed (like when you manually changed things in wallet.dat).

`-reindex` throws away the block chain index and chain state (the database of all unspent transaction outputs), and rebuilds those from scratch. It is exactly like downloading the block chain again from peers, except the blocks already on disk are used.

> **Comments:**
> **username_2**: Does `-reindex` fix corrupted blk files? Say I deleted a random one, will that get downloaded in the process, without having to download the full blockchain?  
> **username_2**: Is `-assumevalid=0` making sure my blk files are getting verified when running a `-reindex`?  
> **username_1**: `-reindex` does not fix corrupted files, but it will detect missing or corrupted ones. In that case the normal block download process from network will start over wherever things went wrong.  
> **username_1**: `-assumevalid=0` only changes whether historical scripts are validated or not (both during normal validation and during reindex). Without it, everything except scripts is still validated.  

---

