As some profiling by @kdomanski showed that we’re doing a very high amount of calls to uint256::CompareTo, in particular for mapBlockIndex operations. So:
- Turn mapBlockIndex into an unordered_map, so it only needs (few) operator== calls on uint256 instead of (multiple) operator< calls.
- Using memcmp for uint256’s operator== and operator!=.