From ca4c9d4bad11f4373ca68ea767e057ca0b24c867 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 1 Nov 2022 23:37:42 +0100 Subject: [PATCH] set_hardfork_height() changed to set all unset prev hardforks to the same height --- src/currency_core/core_runtime_config.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/currency_core/core_runtime_config.h b/src/currency_core/core_runtime_config.h index eaa6416f..8c058ac3 100644 --- a/src/currency_core/core_runtime_config.h +++ b/src/currency_core/core_runtime_config.h @@ -29,6 +29,13 @@ namespace currency { CHECK_AND_ASSERT_THROW_MES(hardfork_id < m_total_count, "invalid hardfork id: " << hardfork_id); m_height_the_hardfork_n_active_after[hardfork_id] = height_the_hardfork_is_active_after; + + // set all unset previous hardforks to this height + for(size_t hid = hardfork_id - 1; hid + 1 != 0; --hid) + { + if (m_height_the_hardfork_n_active_after[hid] == CURRENCY_MAX_BLOCK_NUMBER) + m_height_the_hardfork_n_active_after[hid] = height_the_hardfork_is_active_after; + } } bool is_hardfork_active_for_height(size_t hardfork_id, uint64_t height) const