<p>No, it would not. <code>--reindex</code> only handles the data that is stored on disk. Blocks are stored in the order that they are received, which is what brought you to your current view of the blockchain. So all that would happen is that you end up at that same state.</p>

<p>Switching to another blockchain fork requires your node to be aware of it, so you need to have received those blocks from another node and they will be on your disk. If that chain is truly valid and has more work, then your node will have switched to it without a reindex.</p>

CC BY-SA 4.0
2020-01-21T21:31:02.653Z
2020-01-21T21:31:02.653Z
Ava Chow
<p>I've been reading confusing information online about what the <code>--reindex</code> startup parameter does.</p>

<p>This <a href="https://coinguides.org/rescan-reindex-wallet/" rel="nofollow noreferrer">link</a> is not clear to me.</p>

<p><a href="https://github.com/bitcoin/bitcoin/blob/631df3ee87ec93e1fc748715671cdb5cff7308e6/src/init.cpp#L388" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/631df3ee87ec93e1fc748715671cdb5cff7308e6/src/init.cpp#L388</a></p>

<blockquote>
  <p>gArgs.AddArg("-reindex", "Rebuild chain state and block index from the
  blk*.dat files on disk", ArgsManager::ALLOW_ANY,
  OptionsCategory::OPTIONS);</p>
</blockquote>

<p>So, if I am on a fork because a mandatory upgrade occurred, I did not know about it, and I am no longer on the main chain, would a <code>--reindex</code> fix this?</p>

<bitcoind><client><blockchain-fork><sidechains><reindex>
If I am on a fork, can the reindex parameter fix this?
Sun
# If I am on a fork, can the reindex parameter fix this?

(Asked by: username_0 on 2020-01-21)

I've been reading confusing information online about what the `--reindex` startup parameter does.

This [link](https://coinguides.org/rescan-reindex-wallet/) is not clear to me.

<https://github.com/bitcoin/bitcoin/blob/631df3ee87ec93e1fc748715671cdb5cff7308e6/src/init.cpp#L388>

> gArgs.AddArg("-reindex", "Rebuild chain state and block index from the
> blk\*.dat files on disk", ArgsManager::ALLOW\_ANY,
> OptionsCategory::OPTIONS);

So, if I am on a fork because a mandatory upgrade occurred, I did not know about it, and I am no longer on the main chain, would a `--reindex` fix this?

**Tags:** bitcoind, client, blockchain-fork, sidechains, reindex


---

## 1 answers

### Answer by username_1 on 2020-01-21. Score: 3 | Accepted answer

No, it would not. `--reindex` only handles the data that is stored on disk. Blocks are stored in the order that they are received, which is what brought you to your current view of the blockchain. So all that would happen is that you end up at that same state.

Switching to another blockchain fork requires your node to be aware of it, so you need to have received those blocks from another node and they will be on your disk. If that chain is truly valid and has more work, then your node will have switched to it without a reindex.


---

