text: // Copyright (c) 2009-2012 The Bitcoin developers
  // Copyright (c) 2011-2012 Litecoin Developers
  // Copyright (c) 2013 Zeuscoin Developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  
  #include <boost/assign/list_of.hpp> // for 'map_list_of()'
  #include <boost/foreach.hpp>
  
  #include "checkpoints.h"
  
  #include "main.h"
  #include "uint256.h"
  
  namespace Checkpoints
  {
      typedef std::map<int, uint256> MapCheckpoints;
  
  	// no checkpoint now, can be added in later releases
      static MapCheckpoints mapCheckpoints =
              boost::assign::map_list_of
              (     1, uint256("0x8b555dab406e4dab0dbe8e1abbc2061022aa1b4042f76895c5b8cec1d8cc102a"))
              (   107, uint256("0xfd3c4b7f7b64db74f9af98e70066e45d05978794eb66daaf20c9404c97a9d303"))
              (   223, uint256("0x7450cfbf7f3ffee59544da0735505ff6ce5f414f50bff819bdba33ffe746e76b"))
  			;
  
  
      bool CheckBlock(int nHeight, const uint256& hash)
      {
          if (fTestNet) return true; // Testnet has no checkpoints
  
          MapCheckpoints::const_iterator i = mapCheckpoints.find(nHeight);
          if (i == mapCheckpoints.end()) return true;
          return hash == i->second;
      }
  
      int GetTotalBlocksEstimate()
      {
          if (fTestNet) return 0;
  	
          return mapCheckpoints.rbegin()->first;
      }
  
      CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
      {
          if (fTestNet) return NULL;
  
          BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, mapCheckpoints)
          {
              const uint256& hash = i.second;
              std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
              if (t != mapBlockIndex.end())
                  return t->second;
          }
          return NULL;
      }
  }
  