Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
checkpoints.cpp
Go to the documentation of this file.
1// Copyright (c) 2009-2016 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <checkpoints.h>
6
7#include <chainparams.h>
8
9namespace Checkpoints {
10
11bool CheckBlock(const CCheckpointData &data, int nHeight,
12 const BlockHash &hash) {
14
15 MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
16 if (i == checkpoints.end()) {
17 return true;
18 }
19 return hash == i->second;
20}
21} // namespace Checkpoints
std::map< int, BlockHash > MapCheckpoints
Definition chainparams.h:31
unsigned int nHeight
Block-chain checkpoints are compiled-in sanity checks.
bool CheckBlock(const CCheckpointData &data, int nHeight, const BlockHash &hash)
Returns true if block passes checkpoint checks.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
A BlockHash is a unqiue identifier for a block.
Definition blockhash.h:13
MapCheckpoints mapCheckpoints
Definition chainparams.h:34