diff options
-rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 12 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_core.h | 1 |
2 files changed, 13 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); + } } diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index 0c697df80..10522451c 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -145,6 +145,7 @@ namespace cryptonote bool handle_command_line(const boost::program_options::variables_map& vm, bool testnet); bool on_update_blocktemplate_interval(); bool check_tx_inputs_keyimages_diff(const transaction& tx); + void graceful_exit(); tx_memory_pool m_mempool; |