diff --git a/src/currency_core/currency_core.h b/src/currency_core/currency_core.h index a7df6051..637103b1 100644 --- a/src/currency_core/currency_core.h +++ b/src/currency_core/currency_core.h @@ -68,7 +68,7 @@ namespace currency uint64_t get_current_tx_version() const; uint64_t get_top_block_height() const; std::string get_config_folder(); - bool get_blockchain_top(uint64_t& heeight, crypto::hash& top_id) const; + bool get_blockchain_top(uint64_t& height, crypto::hash& top_id) const; bool get_blocks(uint64_t start_offset, size_t count, std::list& blocks, std::list& txs); bool get_blocks(uint64_t start_offset, size_t count, std::list& blocks); template diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index b9c7a524..94b77505 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -229,7 +229,8 @@ namespace currency template uint64_t t_currency_protocol_handler::get_max_seen_height() { - return m_max_height_seen; + uint64_t max_seen = m_max_height_seen; + return std::max(max_seen, m_core.get_blockchain_storage().get_top_block_height()); } //------------------------------------------------------------------------------------------------------------------------ template