34 #include "misc_log_ex.h"
38 #define ADD_CHECKPOINT(h, hash) CHECK_AND_ASSERT(add_checkpoint(h, hash), false);
39 #define JSON_HASH_FILE_NAME "checkpoints.json"
135 const std::map<uint64_t, crypto::hash>&
get_points()
const;
uint64_t height
Definition: blockchain.cpp:91
A container for blockchain checkpoints.
Definition: checkpoints.h:52
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:96
checkpoints()
default constructor
Definition: checkpoints.cpp:72
bool load_checkpoints_from_dns(network_type nettype=MAINNET)
load new checkpoints from DNS
Definition: checkpoints.cpp:226
bool init_default_checkpoints(network_type nettype)
loads the default main chain checkpoints
Definition: checkpoints.cpp:160
bool load_new_checkpoints(const std::string &json_hashfile_fullpath, network_type nettype=MAINNET, bool dns=true)
load new checkpoints
Definition: checkpoints.cpp:285
bool add_checkpoint(uint64_t height, const std::string &hash_str)
adds a checkpoint to the container
Definition: checkpoints.cpp:76
bool is_in_checkpoint_zone(uint64_t height) const
checks if there is a checkpoint in the future
Definition: checkpoints.cpp:91
bool check_for_conflicts(const checkpoints &other) const
checks if our checkpoints container conflicts with another
Definition: checkpoints.cpp:148
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:121
bool load_checkpoints_from_json(const std::string &json_hashfile_fullpath)
load new checkpoints from json
Definition: checkpoints.cpp:190
const std::map< uint64_t, crypto::hash > & get_points() const
gets the checkpoints container
Definition: checkpoints.cpp:143
std::map< uint64_t, crypto::hash > m_points
the checkpoints container
Definition: checkpoints.h:190
uint64_t get_max_height() const
gets the highest checkpoint height
Definition: checkpoints.cpp:136
POD_CLASS hash
Definition: hash.h:50
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:226
network_type
Definition: cryptonote_config.h:243
@ MAINNET
Definition: cryptonote_config.h:244