Changeset View
Changeset View
Standalone View
Standalone View
src/chain.h
Show All 37 Lines | |||||
/** | /** | ||||
* Maximum gap between node time and block time used | * Maximum gap between node time and block time used | ||||
* for the "Catching up..." mode in GUI. | * for the "Catching up..." mode in GUI. | ||||
* | * | ||||
* Ref: https://github.com/bitcoin/bitcoin/pull/1026 | * Ref: https://github.com/bitcoin/bitcoin/pull/1026 | ||||
*/ | */ | ||||
static constexpr int64_t MAX_BLOCK_TIME_GAP = 90 * 60; | static constexpr int64_t MAX_BLOCK_TIME_GAP = 90 * 60; | ||||
/** | |||||
* Maintain a map of CBlockIndex for all known headers. | |||||
*/ | |||||
struct BlockHasher { | |||||
// this used to call `GetCheapHash()` in uint256, which was later moved; the | |||||
// cheap hash function simply calls ReadLE64() however, so the end result is | |||||
// identical | |||||
size_t operator()(const BlockHash &hash) const { | |||||
return ReadLE64(hash.begin()); | |||||
} | |||||
}; | |||||
extern RecursiveMutex cs_main; | extern RecursiveMutex cs_main; | ||||
arith_uint256 GetBlockProof(const CBlockIndex &block); | arith_uint256 GetBlockProof(const CBlockIndex &block); | ||||
/** | /** | ||||
* Return the time it would take to redo the work difference between from and | * Return the time it would take to redo the work difference between from and | ||||
* to, assuming the current hashrate corresponds to the difficulty at tip, in | * to, assuming the current hashrate corresponds to the difficulty at tip, in | ||||
* seconds. | * seconds. | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |