aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-09-13 18:09:57 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-09-13 18:09:57 +0100
commit8ffc508cef31002942e5548270f55093a4562eb5 (patch)
tree5b1bd8a24ce184e2b27e12d76fccaf79d88f7976 /src/cryptonote_core/cryptonote_core.cpp
parentf85498422d9aec79411c739835ab4a5ed27b1688 (diff)
downloadmonzero-core-8ffc508cef31002942e5548270f55093a4562eb5.tar.gz
monzero-core-8ffc508cef31002942e5548270f55093a4562eb5.tar.xz
monzero-core-8ffc508cef31002942e5548270f55093a4562eb5.zip
core: moan when we think an update is needed to get latest hard fork info
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 4d90eec1e..0769dbb69 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -830,11 +830,37 @@ namespace cryptonote
#else
m_store_blockchain_interval.do_call(boost::bind(&blockchain_storage::store_blockchain, &m_blockchain_storage));
#endif
+ m_fork_moaner.do_call(boost::bind(&core::check_fork_time, this));
m_miner.on_idle();
m_mempool.on_idle();
return true;
}
//-----------------------------------------------------------------------------------------------
+ bool core::check_fork_time()
+ {
+#if BLOCKCHAIN_DB == DB_LMDB
+ HardFork::State state = m_blockchain_storage.get_hard_fork_state();
+ switch (state) {
+ case HardFork::LikelyForked:
+ LOG_PRINT_L0(ENDL
+ << "**********************************************************************" << ENDL
+ << "Last scheduled hard fork is too far in the past." << ENDL
+ << "We are most likely forked from the network. Daemon update needed now." << ENDL
+ << "**********************************************************************" << ENDL);
+ break;
+ case HardFork::UpdateNeeded:
+ LOG_PRINT_L0(ENDL
+ << "**********************************************************************" << ENDL
+ << "Last scheduled hard fork time shows a daemon update is needed now." << ENDL
+ << "**********************************************************************" << ENDL);
+ break;
+ default:
+ break;
+ }
+#endif
+ return true;
+ }
+ //-----------------------------------------------------------------------------------------------
void core::set_target_blockchain_height(uint64_t target_blockchain_height)
{
m_target_blockchain_height = target_blockchain_height;