diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-12-17 12:58:46 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-12-17 12:58:46 +0200 |
commit | b806d9844e4cfdb94e7a2d175efdf41d5ad480ff (patch) | |
tree | f90f634f25079749febf00618ac3160d204f2d7a /src/checkpoints/checkpoints.cpp | |
parent | Merge pull request #2881 (diff) | |
parent | move includes around to lessen overall load (diff) | |
download | monero-b806d9844e4cfdb94e7a2d175efdf41d5ad480ff.tar.xz |
Merge pull request #2864
09ce03d6 move includes around to lessen overall load (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r-- | src/checkpoints/checkpoints.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp index 9be08958c..c66c4f5d6 100644 --- a/src/checkpoints/checkpoints.cpp +++ b/src/checkpoints/checkpoints.cpp @@ -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() { |