Page MenuHomePhabricator

checkpoints.cpp
No OneTemporary

checkpoints.cpp

// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "checkpoints.h"
#include "chain.h"
#include "chainparams.h"
#include "uint256.h"
#include "validation.h"
#include <cstdint>
#include <boost/range/adaptor/reversed.hpp>
namespace Checkpoints {
CBlockIndex *GetLastCheckpoint(const CCheckpointData &data) {
const MapCheckpoints &checkpoints = data.mapCheckpoints;
for (const MapCheckpoints::value_type &i :
boost::adaptors::reverse(checkpoints)) {
const uint256 &hash = i.second;
BlockMap::const_iterator t = mapBlockIndex.find(hash);
if (t != mapBlockIndex.end()) return t->second;
}
return NULL;
}
} // namespace Checkpoints

File Metadata

Mime Type
text/x-c++
Expires
Sat, Nov 23, 10:05 (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4520697
Default Alt Text
checkpoints.cpp (834 B)

Event Timeline