Merge bitcoin/bitcoin#29624: doc: update NeedsRedownload() and nStatus comment
Some checks are pending
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run

af9f987893 doc: update NeedsRedownload() comment (Sjors Provoost)

Pull request description:

  Noticed two outdated comments while reviewing #29370.

  Since #21009 we no longer roll back the chain, when a user updates a pre-segwit node to a modern node. In this unlikely scenario we tell the user to `-reindex`.

  This PR updates a comment in `PopulateAndValidateSnapshot` to reflect that change. Ditto for the description of `nStatus` in `chain.h`.

ACKs for top commit:
  maflcko:
    re-ACK af9f987893
  fjahr:
    ACK af9f987893

Tree-SHA512: d590f1cff6823297764c863753ed5478b8933d503c43933902d50b449dfd852a02aeb318c072ad25d02e4c2583d7026cd176a10b0584292d6bbe381a063f5c45
This commit is contained in:
merge-script 2024-09-17 15:27:29 +01:00
commit 6fc4692797
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 2 additions and 2 deletions

View file

@ -178,7 +178,7 @@ public:
//! Verification status of this block. See enum BlockStatus
//!
//! Note: this value is modified to show BLOCK_OPT_WITNESS during UTXO snapshot
//! load to avoid the block index being spuriously rewound.
//! load to avoid a spurious startup failure requiring -reindex.
//! @sa NeedsRedownload
//! @sa ActivateSnapshot
uint32_t nStatus GUARDED_BY(::cs_main){0};

View file

@ -6014,7 +6014,7 @@ util::Result<void> ChainstateManager::PopulateAndValidateSnapshot(
index = snapshot_chainstate.m_chain[i];
// Fake BLOCK_OPT_WITNESS so that Chainstate::NeedsRedownload()
// won't ask to rewind the entire assumed-valid chain on startup.
// won't ask for -reindex on startup.
if (DeploymentActiveAt(*index, *this, Consensus::DEPLOYMENT_SEGWIT)) {
index->nStatus |= BLOCK_OPT_WITNESS;
}