From 78035d2b6c9922f4cd730df0766aa74f4854ccb2 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Tue, 23 Aug 2016 22:52:25 -0400 Subject: [PATCH] Fix fake 'network synchronized, begin using' messages --- src/cryptonote_core/cryptonote_core.cpp | 5 ++++- src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 25b750b1..26748ace 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -957,7 +957,10 @@ namespace cryptonote //----------------------------------------------------------------------------------------------- void core::set_target_blockchain_height(uint64_t target_blockchain_height) { - m_target_blockchain_height = target_blockchain_height; + if (target_blockchain_height > m_target_blockchain_height) + { + m_target_blockchain_height = target_blockchain_height; + } } //----------------------------------------------------------------------------------------------- uint64_t core::get_target_blockchain_height() const diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 9f0ea0e8..6f095a76 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -263,7 +263,7 @@ namespace cryptonote if(context.m_state == cryptonote_connection_context::state_synchronizing) return true; - if(m_core.have_block(hshd.top_id)) + if(m_core.have_block(hshd.top_id) && !(hshd.current_height < m_core.get_target_blockchain_height())) { context.m_state = cryptonote_connection_context::state_normal; if(is_inital)