aboutsummaryrefslogtreecommitdiff
path: root/src/chain.h
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2024-02-05 17:10:27 -0500
committerRyan Ofsky <ryan@ofsky.org>2024-03-18 11:28:40 -0500
commit9d9a7458a2570f7db56ab626b22010591089c312 (patch)
treeefaf719708835161ade2922c96aa56d70cd8a921 /src/chain.h
parentef174e9ed21c08f38e5d4b537b6decfd1f646db9 (diff)
downloadbitcoin-9d9a7458a2570f7db56ab626b22010591089c312.tar.xz
assumeutxo: Remove BLOCK_ASSUMED_VALID flag
Flag adds complexity and is not currently used for anything.
Diffstat (limited to 'src/chain.h')
-rw-r--r--src/chain.h31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/chain.h b/src/chain.h
index 7faeb25088..bb70dbd8bc 100644
--- a/src/chain.h
+++ b/src/chain.h
@@ -128,21 +128,8 @@ enum BlockStatus : uint32_t {
BLOCK_OPT_WITNESS = 128, //!< block data in blk*.dat was received with a witness-enforcing client
- /**
- * If ASSUMED_VALID is set, it means that this block has not been validated
- * and has validity status less than VALID_SCRIPTS. Also that it may have
- * descendant blocks with VALID_SCRIPTS set, because they can be validated
- * based on an assumeutxo snapshot.
- *
- * When an assumeutxo snapshot is loaded, the ASSUMED_VALID flag is added to
- * unvalidated blocks at the snapshot height and below. Then, as the background
- * validation progresses, and these blocks are validated, the ASSUMED_VALID
- * flags are removed. See `doc/design/assumeutxo.md` for details.
- *
- * This flag is only used to implement checks in CheckBlockIndex() and
- * should not be used elsewhere.
- */
- BLOCK_ASSUMED_VALID = 256,
+ BLOCK_STATUS_RESERVED = 256, //!< Unused flag that was previously set on assumeutxo snapshot blocks and their
+ //!< ancestors before they were validated, and unset when they were validated.
};
/** The block chain is a tree shaped structure starting with the
@@ -316,14 +303,6 @@ public:
return ((nStatus & BLOCK_VALID_MASK) >= nUpTo);
}
- //! @returns true if the block is assumed-valid; this means it is queued to be
- //! validated by a background chainstate.
- bool IsAssumedValid() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
- {
- AssertLockHeld(::cs_main);
- return nStatus & BLOCK_ASSUMED_VALID;
- }
-
//! Raise the validity level of this block index entry.
//! Returns true if the validity was changed.
bool RaiseValidity(enum BlockStatus nUpTo) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
@@ -333,12 +312,6 @@ public:
if (nStatus & BLOCK_FAILED_MASK) return false;
if ((nStatus & BLOCK_VALID_MASK) < nUpTo) {
- // If this block had been marked assumed-valid and we're raising
- // its validity to a certain point, there is no longer an assumption.
- if (nStatus & BLOCK_ASSUMED_VALID && nUpTo >= BLOCK_VALID_SCRIPTS) {
- nStatus &= ~BLOCK_ASSUMED_VALID;
- }
-
nStatus = (nStatus & ~BLOCK_VALID_MASK) | nUpTo;
return true;
}