2016-01-18 15:33:29 +00:00
|
|
|
// Copyright (c) 2011-2016 The Cryptonote developers
|
2015-09-18 11:55:31 +00:00
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2014-03-03 22:07:58 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
2015-07-30 15:22:07 +00:00
|
|
|
#include "CryptoNoteBasicImpl.h"
|
2015-05-27 12:08:46 +00:00
|
|
|
#include <Logging/LoggerRef.h>
|
2014-03-03 22:07:58 +00:00
|
|
|
|
2015-05-27 12:08:46 +00:00
|
|
|
namespace CryptoNote
|
2014-03-03 22:07:58 +00:00
|
|
|
{
|
2015-07-30 15:22:07 +00:00
|
|
|
class Checkpoints
|
2014-03-03 22:07:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-07-30 15:22:07 +00:00
|
|
|
Checkpoints(Logging::ILogger& log);
|
2015-05-27 12:08:46 +00:00
|
|
|
|
2015-07-30 15:22:07 +00:00
|
|
|
bool add_checkpoint(uint32_t height, const std::string& hash_str);
|
|
|
|
bool is_in_checkpoint_zone(uint32_t height) const;
|
|
|
|
bool check_block(uint32_t height, const Crypto::Hash& h) const;
|
|
|
|
bool check_block(uint32_t height, const Crypto::Hash& h, bool& is_a_checkpoint) const;
|
|
|
|
bool is_alternative_block_allowed(uint32_t blockchain_height, uint32_t block_height) const;
|
2014-05-15 16:40:40 +00:00
|
|
|
|
2014-03-03 22:07:58 +00:00
|
|
|
private:
|
2015-07-30 15:22:07 +00:00
|
|
|
std::map<uint32_t, Crypto::Hash> m_points;
|
2015-05-27 12:08:46 +00:00
|
|
|
Logging::LoggerRef logger;
|
2014-03-03 22:07:58 +00:00
|
|
|
};
|
|
|
|
}
|