33 #include "misc_log_ex.h"
38 #define ADD_CHECKPOINT(h, hash) CHECK_AND_ASSERT(add_checkpoint(h, hash), false);
39 #define ADD_CHECKPOINT2(h, hash, difficulty) CHECK_AND_ASSERT(add_checkpoint(h, hash, difficulty), false);
40 #define JSON_HASH_FILE_NAME "checkpoints.json"
72 bool add_checkpoint(uint64_t height,
const std::string& hash_str,
const std::string& difficulty_str =
"");
137 const std::map<uint64_t, crypto::hash>&
get_points()
const;
A container for blockchain checkpoints.
Definition: checkpoints.h:53
bool check_block(uint64_t height, const crypto::hash &h, bool &is_a_checkpoint) const
checks if the given height and hash agree with the checkpoints
Definition: checkpoints.cpp:112
checkpoints()
default constructor
Definition: checkpoints.cpp:71
bool load_checkpoints_from_dns(network_type nettype=MAINNET)
load new checkpoints from DNS
Definition: checkpoints.cpp:288
bool init_default_checkpoints(network_type nettype)
loads the default main chain checkpoints
Definition: checkpoints.cpp:181
std::map< uint64_t, difficulty_type > m_difficulty_points
the difficulty checkpoints container
Definition: checkpoints.h:200
bool load_new_checkpoints(const std::string &json_hashfile_fullpath, network_type nettype=MAINNET, bool dns=true)
load new checkpoints
Definition: checkpoints.cpp:344
bool is_in_checkpoint_zone(uint64_t height) const
checks if there is a checkpoint in the future
Definition: checkpoints.cpp:107
bool check_for_conflicts(const checkpoints &other) const
checks if our checkpoints container conflicts with another
Definition: checkpoints.cpp:169
bool is_alternative_block_allowed(uint64_t blockchain_height, uint64_t block_height) const
checks if alternate chain blocks should be kept for a given height
Definition: checkpoints.cpp:137
bool load_checkpoints_from_json(const std::string &json_hashfile_fullpath)
load new checkpoints from json
Definition: checkpoints.cpp:252
const std::map< uint64_t, crypto::hash > & get_points() const
gets the checkpoints container
Definition: checkpoints.cpp:159
bool add_checkpoint(uint64_t height, const std::string &hash_str, const std::string &difficulty_str="")
adds a checkpoint to the container
Definition: checkpoints.cpp:75
std::map< uint64_t, crypto::hash > m_points
the checkpoints container
Definition: checkpoints.h:199
const std::map< uint64_t, difficulty_type > & get_difficulty_points() const
gets the difficulty checkpoints container
Definition: checkpoints.cpp:164
uint64_t get_max_height() const
gets the highest checkpoint height
Definition: checkpoints.cpp:152
POD_CLASS hash
Definition: hash.h:48
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:45
network_type
Definition: cryptonote_config.h:273
@ MAINNET
Definition: cryptonote_config.h:274