Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
* Default for -finalizationdelay | * Default for -finalizationdelay | ||||
* This is the minimum time between a block header reception and the block | * This is the minimum time between a block header reception and the block | ||||
* finalization. | * finalization. | ||||
* This value should be >> block propagation and validation time | * This value should be >> block propagation and validation time | ||||
*/ | */ | ||||
static const int64_t DEFAULT_MIN_FINALIZATION_DELAY = 2 * 60 * 60; | static const int64_t DEFAULT_MIN_FINALIZATION_DELAY = 2 * 60 * 60; | ||||
/** | /** | ||||
* Block files containing a block-height within MIN_BLOCKS_TO_KEEP of | * Block files containing a block-height within MIN_BLOCKS_TO_KEEP of | ||||
* ::ChainActive().Tip() will not be pruned. | * ActiveChain().Tip() will not be pruned. | ||||
*/ | */ | ||||
static const unsigned int MIN_BLOCKS_TO_KEEP = 288; | static const unsigned int MIN_BLOCKS_TO_KEEP = 288; | ||||
static const signed int DEFAULT_CHECKBLOCKS = 6; | static const signed int DEFAULT_CHECKBLOCKS = 6; | ||||
static const unsigned int DEFAULT_CHECKLEVEL = 3; | static const unsigned int DEFAULT_CHECKLEVEL = 3; | ||||
/** | /** | ||||
* Require that user allocate at least 550 MiB for block & undo files | * Require that user allocate at least 550 MiB for block & undo files | ||||
* (blk???.dat and rev???.dat) | * (blk???.dat and rev???.dat) | ||||
* At 1MB per block, 288 blocks = 288MB. | * At 1MB per block, 288 blocks = 288MB. | ||||
▲ Show 20 Lines • Show All 1,053 Lines • ▼ Show 20 Lines | public: | ||||
//! - Initialize an unused CChainState. | //! - Initialize an unused CChainState. | ||||
//! - Load its `CoinsViews` contents from `coins_file`. | //! - Load its `CoinsViews` contents from `coins_file`. | ||||
//! - Verify that the hash of the resulting coinsdb matches the expected | //! - Verify that the hash of the resulting coinsdb matches the expected | ||||
//! hash per assumeutxo chain parameters. | //! hash per assumeutxo chain parameters. | ||||
//! - Wait for our headers chain to include the base block of the snapshot. | //! - Wait for our headers chain to include the base block of the snapshot. | ||||
//! - "Fast forward" the tip of the new chainstate to the base of the | //! - "Fast forward" the tip of the new chainstate to the base of the | ||||
//! snapshot, faking nTx* block index data along the way. | //! snapshot, faking nTx* block index data along the way. | ||||
//! - Move the new chainstate to `m_snapshot_chainstate` and make it our | //! - Move the new chainstate to `m_snapshot_chainstate` and make it our | ||||
//! ChainstateActive(). | //! ActiveChainstate(). | ||||
[[nodiscard]] bool ActivateSnapshot(CAutoFile &coins_file, | [[nodiscard]] bool ActivateSnapshot(CAutoFile &coins_file, | ||||
const SnapshotMetadata &metadata, | const SnapshotMetadata &metadata, | ||||
bool in_memory); | bool in_memory); | ||||
//! The most-work chain. | //! The most-work chain. | ||||
CChainState &ActiveChainstate() const; | CChainState &ActiveChainstate() const; | ||||
CChain &ActiveChain() const { return ActiveChainstate().m_chain; } | CChain &ActiveChain() const { return ActiveChainstate().m_chain; } | ||||
int ActiveHeight() const { return ActiveChain().Height(); } | int ActiveHeight() const { return ActiveChain().Height(); } | ||||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |