From 8a41e1edd4d31d08b7360d7e5964c1c40a7aa1b6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 4 Sep 2014 02:03:17 +0200 Subject: [PATCH] Use boost::unordered_map for mapBlockIndex --- src/main.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.h b/src/main.h index da2b5cac8..8c0a743e2 100644 --- a/src/main.h +++ b/src/main.h @@ -29,6 +29,8 @@ #include #include +#include + class CBlockIndex; class CBloomFilter; class CInv; @@ -81,11 +83,15 @@ 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; -typedef std::map BlockMap; +typedef boost::unordered_map BlockMap; extern BlockMap mapBlockIndex; extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize;