mirror of
https://github.com/monero-project/monero.git
synced 2025-07-30 11:38:38 -04:00
move includes around to lessen overall load
This commit is contained in:
parent
38ecd0526e
commit
09ce03d612
73 changed files with 212 additions and 161 deletions
|
@ -36,15 +36,38 @@ using namespace epee;
|
|||
|
||||
#include "common/dns_utils.h"
|
||||
#include "include_base_utils.h"
|
||||
#include "string_tools.h"
|
||||
#include "storages/portable_storage_template_helper.h" // epee json include
|
||||
#include <sstream>
|
||||
#include <random>
|
||||
#include "serialization/keyvalue_serialization.h"
|
||||
|
||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||
#define MONERO_DEFAULT_LOG_CATEGORY "checkpoints"
|
||||
|
||||
namespace cryptonote
|
||||
{
|
||||
/**
|
||||
* @brief struct for loading a checkpoint from json
|
||||
*/
|
||||
struct t_hashline
|
||||
{
|
||||
uint64_t height; //!< the height of the checkpoint
|
||||
std::string hash; //!< the hash for the checkpoint
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(height)
|
||||
KV_SERIALIZE(hash)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief struct for loading many checkpoints from json
|
||||
*/
|
||||
struct t_hash_json {
|
||||
std::vector<t_hashline> hashlines; //!< the checkpoint lines from the file
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(hashlines)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
checkpoints::checkpoints()
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <vector>
|
||||
#include "misc_log_ex.h"
|
||||
#include "crypto/hash.h"
|
||||
#include "serialization/keyvalue_serialization.h"
|
||||
|
||||
#define ADD_CHECKPOINT(h, hash) CHECK_AND_ASSERT(add_checkpoint(h, hash), false);
|
||||
#define JSON_HASH_FILE_NAME "checkpoints.json"
|
||||
|
@ -187,32 +186,7 @@ namespace cryptonote
|
|||
bool load_checkpoints_from_dns(bool testnet = false);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
/**
|
||||
* @brief struct for loading a checkpoint from json
|
||||
*/
|
||||
struct t_hashline
|
||||
{
|
||||
uint64_t height; //!< the height of the checkpoint
|
||||
std::string hash; //!< the hash for the checkpoint
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(height)
|
||||
KV_SERIALIZE(hash)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief struct for loading many checkpoints from json
|
||||
*/
|
||||
struct t_hash_json {
|
||||
std::vector<t_hashline> hashlines; //!< the checkpoint lines from the file
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(hashlines)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
std::map<uint64_t, crypto::hash> m_points; //!< the checkpoints container
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue