Changeset View
Changeset View
Standalone View
Standalone View
src/chain.h
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Maintain a map of CBlockIndex for all known headers. | * Maintain a map of CBlockIndex for all known headers. | ||||
*/ | */ | ||||
struct BlockHasher { | struct BlockHasher { | ||||
size_t operator()(const uint256 &hash) const { return hash.GetCheapHash(); } | size_t operator()(const uint256 &hash) const { return hash.GetCheapHash(); } | ||||
}; | }; | ||||
typedef std::unordered_map<uint256, CBlockIndex *, BlockHasher> BlockMap; | typedef std::unordered_map<uint256, CBlockIndex *, BlockHasher> BlockMap; | ||||
extern BlockMap mapBlockIndex; | extern BlockMap &mapBlockIndex; | ||||
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 161 Lines • Show Last 20 Lines |