Changeset View
Changeset View
Standalone View
Standalone View
src/chain.h
Show All 18 Lines | |||||
#include <unordered_map> | #include <unordered_map> | ||||
#include <vector> | #include <vector> | ||||
/** | /** | ||||
* Maximum amount of time that a block timestamp is allowed to exceed the | * Maximum amount of time that a block timestamp is allowed to exceed the | ||||
* current network-adjusted time before the block will be accepted. | * current network-adjusted time before the block will be accepted. | ||||
*/ | */ | ||||
static const int64_t MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60; | static constexpr int64_t MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60; | ||||
/** | /** | ||||
* Timestamp window used as a grace period by code that compares external | * Timestamp window used as a grace period by code that compares external | ||||
* timestamps (such as timestamps passed to RPCs, or wallet key creation times) | * timestamps (such as timestamps passed to RPCs, or wallet key creation times) | ||||
* to block timestamps. This should be set at least as high as | * to block timestamps. This should be set at least as high as | ||||
* MAX_FUTURE_BLOCK_TIME. | * MAX_FUTURE_BLOCK_TIME. | ||||
*/ | */ | ||||
static const int64_t TIMESTAMP_WINDOW = MAX_FUTURE_BLOCK_TIME; | static constexpr int64_t TIMESTAMP_WINDOW = MAX_FUTURE_BLOCK_TIME; | ||||
/** | |||||
* Maximum gap between node time and block time used | |||||
* for the "Catching up..." mode in GUI. | |||||
* | |||||
* Ref: https://github.com/bitcoin/bitcoin/pull/1026 | |||||
*/ | |||||
static constexpr int64_t MAX_BLOCK_TIME_GAP = 90 * 60; | |||||
/** | /** | ||||
* The block chain is a tree shaped structure starting with the genesis block at | * The block chain is a tree shaped structure starting with the genesis block at | ||||
* the root, with each block potentially having multiple candidates to be the | * the root, with each block potentially having multiple candidates to be the | ||||
* next block. A blockindex may have multiple pprev pointing to it, but at most | * next block. A blockindex may have multiple pprev pointing to it, but at most | ||||
* one of them can be part of the currently active branch. | * one of them can be part of the currently active branch. | ||||
*/ | */ | ||||
class CBlockIndex { | class CBlockIndex { | ||||
▲ Show 20 Lines • Show All 376 Lines • Show Last 20 Lines |