diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-04 02:03:17 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-04 02:05:20 +0200 |
commit | 8a41e1edd4d31d08b7360d7e5964c1c40a7aa1b6 (patch) | |
tree | d765974a607527f381e0f9da573d08320e2e7790 /src | |
parent | 145d5be896db4e8fda17039bed26100e38fae2f0 (diff) |
Use boost::unordered_map for mapBlockIndex
Diffstat (limited to 'src')
-rw-r--r-- | src/main.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h index da2b5cac81..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,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<uint256, CBlockIndex*> BlockMap; +typedef boost::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap; extern BlockMap mapBlockIndex; extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize; |