1
0
Fork 0
forked from lthn/blockchain

now max_seed_height is always greater then or equal to current node's top block height

This commit is contained in:
sowle 2025-01-31 17:30:02 +01:00
parent 8fc70f4d6d
commit 3d1f4a5336
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 3 additions and 2 deletions

View file

@ -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<block>& blocks, std::list<transaction>& txs);
bool get_blocks(uint64_t start_offset, size_t count, std::list<block>& blocks);
template<class t_ids_container, class t_blocks_container, class t_missed_container>

View file

@ -229,7 +229,8 @@ namespace currency
template<class t_core>
uint64_t t_currency_protocol_handler<t_core>::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<class t_core>