Explain when reindex-chainstate can be used instead of reindex #13662

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2018/07/reindex-chainstate-doc changing 1 files +1 −1
  1. Sjors commented at 2:43 PM on July 14, 2018: member

    Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711

  2. Sjors force-pushed on Jul 14, 2018
  3. fanquake added the label Docs on Jul 14, 2018
  4. Explain when reindex-chainstate can be used instead of reindex 65a449f8e3
  5. in src/init.cpp:387 in 6c53e46179 outdated
     383 | @@ -384,7 +384,7 @@ void SetupServerArgs()
     384 |              "Warning: Reverting this setting requires re-downloading the entire blockchain. "
     385 |              "(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS);
     386 |      gArgs.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", false, OptionsCategory::OPTIONS);
     387 | -    gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks", false, OptionsCategory::OPTIONS);
     388 | +    gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. Only necessary in pruning mode or if blocks on disk might be corrupted.", false, OptionsCategory::OPTIONS);
    


    MarcoFalke commented at 2:53 PM on July 14, 2018:

    If the blocks on disk are corrupted, you should do a "full" reindex, not rebuild the chainstate.


    Sjors commented at 3:44 PM on July 14, 2018:

    Oops, I got the comment the wrong way around.

  6. Sjors force-pushed on Jul 14, 2018
  7. in src/init.cpp:387 in 65a449f8e3
     383 | @@ -384,7 +384,7 @@ void SetupServerArgs()
     384 |              "Warning: Reverting this setting requires re-downloading the entire blockchain. "
     385 |              "(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS);
     386 |      gArgs.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", false, OptionsCategory::OPTIONS);
     387 | -    gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks", false, OptionsCategory::OPTIONS);
     388 | +    gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead.", false, OptionsCategory::OPTIONS);
    


    MarcoFalke commented at 4:40 PM on July 14, 2018:

    I believe it will automatically prompt you to use -reindex when needed while in pruning mode, so maybe no need to mention it here?

    Then, you could move the note about corruption to reindex. E.g. "Rebuild chain state and block index from the blk.dat files on disk *. Only needed when blocks on disk are corrupted. "


    Sjors commented at 1:01 PM on July 16, 2018:

    I just sabotaged a pruned node by deleting the most recent blkxxxxx.dat file and then started bitcoind: Please restart with -reindex or -reindex-chainstate to recover.

    Restarting that pruned node with -reindex-chainstate will result in the same error message and won't tell the user they need to use -reindex instead. So I think it's better to mention pruned node in the help here.

  8. MarcoFalke commented at 4:40 PM on July 14, 2018: member

    Concept ACK

  9. randolf approved
  10. MarcoFalke commented at 6:22 PM on September 7, 2018: member

    utACK 65a449f8e3

  11. MarcoFalke merged this on Sep 7, 2018
  12. MarcoFalke closed this on Sep 7, 2018

  13. MarcoFalke referenced this in commit fb06eb4ef7 on Sep 7, 2018
  14. Sjors deleted the branch on Sep 7, 2018
  15. jasonbcox referenced this in commit 7d378722c7 on Dec 20, 2019
  16. jonspock referenced this in commit c19015eaeb on Oct 2, 2020
  17. jonspock referenced this in commit 6bfb03aae5 on Oct 5, 2020
  18. jonspock referenced this in commit d2b7e882e7 on Oct 10, 2020
  19. PastaPastaPasta referenced this in commit 249b096928 on Jul 19, 2021
  20. PastaPastaPasta referenced this in commit 0e3c42f0e2 on Jul 19, 2021
  21. PastaPastaPasta referenced this in commit e517d78269 on Jul 19, 2021
  22. PastaPastaPasta referenced this in commit 6f501ade6f on Jul 19, 2021
  23. MarcoFalke locked this on Sep 8, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me