From 3d1f4a53361f28651adeb90d6d459e1b6fe85789 Mon Sep 17 00:00:00 2001 From: sowle Date: Fri, 31 Jan 2025 17:30:02 +0100 Subject: [PATCH] now max_seed_height is always greater then or equal to current node's top block height --- src/currency_core/currency_core.h | 2 +- src/currency_protocol/currency_protocol_handler.inl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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