aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-10 15:06:04 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-18 15:15:23 +0000
commit061789b5dd8a84e6914ed8536e8bd66c656a63e5 (patch)
tree1c8f349a9a79ca84a0f220fcf0486316d598e46f
parentcheckpoints: pass std::string by const ref, not const value (diff)
downloadmonero-061789b5dd8a84e6914ed8536e8bd66c656a63e5.tar.xz
checkpoints: trap failure to load JSON checkpoints
-rw-r--r--src/checkpoints/checkpoints.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp
index e6253c73d..67a313bc2 100644
--- a/src/checkpoints/checkpoints.cpp
+++ b/src/checkpoints/checkpoints.cpp
@@ -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;