aboutsummaryrefslogtreecommitdiff
path: root/src/checkpoints
diff options
context:
space:
mode:
Diffstat (limited to 'src/checkpoints')
-rw-r--r--src/checkpoints/checkpoints.cpp10
-rw-r--r--src/checkpoints/checkpoints.h4
2 files changed, 9 insertions, 5 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp
index c66c4f5d6..67a313bc2 100644
--- a/src/checkpoints/checkpoints.cpp
+++ b/src/checkpoints/checkpoints.cpp
@@ -204,7 +204,7 @@ namespace cryptonote
return true;
}
- bool checkpoints::load_checkpoints_from_json(const std::string json_hashfile_fullpath)
+ bool checkpoints::load_checkpoints_from_json(const std::string &json_hashfile_fullpath)
{
boost::system::error_code errcode;
if (! (boost::filesystem::exists(json_hashfile_fullpath, errcode)))
@@ -218,7 +218,11 @@ namespace cryptonote
uint64_t prev_max_height = get_max_height();
LOG_PRINT_L1("Hard-coded max checkpoint height is " << prev_max_height);
t_hash_json hashes;
- epee::serialization::load_t_from_json_file(hashes, json_hashfile_fullpath);
+ if (!epee::serialization::load_t_from_json_file(hashes, json_hashfile_fullpath))
+ {
+ MERROR("Error loading checkpoints from " << json_hashfile_fullpath);
+ return false;
+ }
for (std::vector<t_hashline>::const_iterator it = hashes.hashlines.begin(); it != hashes.hashlines.end(); )
{
uint64_t height;
@@ -286,7 +290,7 @@ namespace cryptonote
return true;
}
- bool checkpoints::load_new_checkpoints(const std::string json_hashfile_fullpath, bool testnet, bool dns)
+ bool checkpoints::load_new_checkpoints(const std::string &json_hashfile_fullpath, bool testnet, bool dns)
{
bool result;
diff --git a/src/checkpoints/checkpoints.h b/src/checkpoints/checkpoints.h
index 3e034f6f0..83969f7b8 100644
--- a/src/checkpoints/checkpoints.h
+++ b/src/checkpoints/checkpoints.h
@@ -165,7 +165,7 @@ namespace cryptonote
*
* @return true if loading successful and no conflicts
*/
- bool load_new_checkpoints(const std::string json_hashfile_fullpath, bool testnet=false, bool dns=true);
+ bool load_new_checkpoints(const std::string &json_hashfile_fullpath, bool testnet=false, bool dns=true);
/**
* @brief load new checkpoints from json
@@ -174,7 +174,7 @@ namespace cryptonote
*
* @return true if loading successful and no conflicts
*/
- bool load_checkpoints_from_json(const std::string json_hashfile_fullpath);
+ bool load_checkpoints_from_json(const std::string &json_hashfile_fullpath);
/**
* @brief load new checkpoints from DNS