Changeset View
Changeset View
Standalone View
Standalone View
src/chain.h
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | size_t operator()(const BlockHash &hash) const { | ||||
return ReadLE64(hash.begin()); | return ReadLE64(hash.begin()); | ||||
} | } | ||||
}; | }; | ||||
extern RecursiveMutex cs_main; | extern RecursiveMutex cs_main; | ||||
typedef std::unordered_map<BlockHash, CBlockIndex *, BlockHasher> BlockMap; | typedef std::unordered_map<BlockHash, CBlockIndex *, BlockHasher> BlockMap; | ||||
extern BlockMap &mapBlockIndex GUARDED_BY(cs_main); | extern BlockMap &mapBlockIndex GUARDED_BY(cs_main); | ||||
inline CBlockIndex *LookupBlockIndex(const BlockHash &hash) { | inline CBlockIndex *LookupBlockIndex(const BlockHash &hash) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | |||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
BlockMap::const_iterator it = mapBlockIndex.find(hash); | BlockMap::const_iterator it = mapBlockIndex.find(hash); | ||||
return it == mapBlockIndex.end() ? nullptr : it->second; | return it == mapBlockIndex.end() ? nullptr : it->second; | ||||
} | } | ||||
arith_uint256 GetBlockProof(const CBlockIndex &block); | arith_uint256 GetBlockProof(const CBlockIndex &block); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |