diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-08-07 15:08:31 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-08-07 15:08:31 +0200 |
commit | 0f36efbded4a0cc4f8fb2a892f6b85281c5fe023 (patch) | |
tree | 0050bc84467935f2de5fbe2e09e36bc6d1ed920c /src/cryptonote_core | |
parent | Merge pull request #2197 (diff) | |
parent | blockchain: one off warning when seeing a block with unknown version (diff) | |
download | monero-0f36efbded4a0cc4f8fb2a892f6b85281c5fe023.tar.xz |
Merge pull request #2198
53af9768 blockchain: one off warning when seeing a block with unknown version (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 745608b9f..1602cd06d 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3097,6 +3097,8 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash& CRITICAL_REGION_LOCAL(m_blockchain_lock); TIME_MEASURE_START(t1); + static bool seen_future_version = false; + m_db->block_txn_start(true); if(bl.prev_id != get_tail_id()) { @@ -3106,6 +3108,18 @@ leave: return false; } + // warn users if they're running an old version + if (!seen_future_version && bl.major_version > m_hardfork->get_ideal_version()) + { + seen_future_version = true; + const el::Level level = el::Level::Warning; + MCLOG_RED(level, "global", "**********************************************************************"); + MCLOG_RED(level, "global", "A block was seen on the network with a version higher than the last"); + MCLOG_RED(level, "global", "known one. This may be an old version of the daemon, and a software"); + MCLOG_RED(level, "global", "update may be required to sync further. Try running: update check"); + MCLOG_RED(level, "global", "**********************************************************************"); + } + // this is a cheap test if (!m_hardfork->check(bl)) { |