aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2014-09-30 15:24:43 -0400
committerThomas Winget <tewinget@gmail.com>2014-09-30 16:21:37 -0400
commitc0bdd511c3309e78488051f6a21b0b30ed25af44 (patch)
tree00fe3e23bac049dea9cf9eb90e4d2867a50b320c /src/cryptonote_core/cryptonote_core.cpp
parentf0b4138f1f6ecb86c971dd7edf72a92d54e22721 (diff)
downloadmonzero-core-c0bdd511c3309e78488051f6a21b0b30ed25af44.tar.gz
monzero-core-c0bdd511c3309e78488051f6a21b0b30ed25af44.tar.xz
monzero-core-c0bdd511c3309e78488051f6a21b0b30ed25af44.zip
Daemon should now exit on conflicting checkpoints
If the "enforce DNS checkpoints" flag is not enabled, it should not exit if DNS checkpoints conflict with the others, but should still print a warning to the user.
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index c83e6e0a0..d9d8a7faf 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -41,6 +41,7 @@ using namespace epee;
#include "cryptonote_config.h"
#include "cryptonote_format_utils.h"
#include "misc_language.h"
+#include <csignal>
DISABLE_VS_WARNINGS(4355)
@@ -98,6 +99,12 @@ namespace cryptonote
res = m_blockchain_storage.update_checkpoints(m_checkpoints_path, false);
m_last_json_checkpoints_update = time(NULL);
}
+
+ // if anything fishy happened getting new checkpoints, bring down the house
+ if (!res)
+ {
+ graceful_exit();
+ }
return res;
}
//-----------------------------------------------------------------------------------
@@ -583,4 +590,9 @@ namespace cryptonote
uint64_t core::get_target_blockchain_height() const {
return m_target_blockchain_height;
}
+ //-----------------------------------------------------------------------------------------------
+ void core::graceful_exit()
+ {
+ raise(SIGTERM);
+ }
}