diff options
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h index d38d033d2c..8c0a743e24 100644 --- a/src/main.h +++ b/src/main.h @@ -29,6 +29,8 @@ #include <utility> #include <vector> +#include <boost/unordered_map.hpp> + class CBlockIndex; class CBloomFilter; class CInv; @@ -81,11 +83,16 @@ static const unsigned char REJECT_DUST = 0x41; static const unsigned char REJECT_INSUFFICIENTFEE = 0x42; static const unsigned char REJECT_CHECKPOINT = 0x43; +struct BlockHasher +{ + size_t operator()(const uint256& hash) const { return hash.GetLow64(); } +}; extern CScript COINBASE_FLAGS; extern CCriticalSection cs_main; extern CTxMemPool mempool; -extern std::map<uint256, CBlockIndex*> mapBlockIndex; +typedef boost::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap; +extern BlockMap mapBlockIndex; extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize; extern const std::string strMessageMagic; |