From 252297fecdc5c032b725398fb23b78de7f7ee3f4 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Sat, 3 Feb 2024 16:03:18 +0100 Subject: [PATCH] putting back validation of max_related_block_height --- src/currency_core/blockchain_storage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index d8f1ec1b..1c85df9f 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -6104,6 +6104,8 @@ bool blockchain_storage::validate_pos_block(const block& b, if (m_core_runtime_config.is_hardfork_active_for_height(1, get_block_height(b))) { + uint64_t last_pow_h = get_last_x_block_height(false); + CHECK_AND_ASSERT_MES(max_related_block_height <= last_pow_h, false, "Failed to validate coinbase in PoS block, condition failed: max_related_block_height(" << max_related_block_height << ") <= last_pow_h(" << last_pow_h << ")"); //let's check that coinbase amount and unlock time r = validate_pos_coinbase_outs_unlock_time(b.miner_tx, coinstake_in.amount, source_max_unlock_time_for_pos_coinbase); CHECK_AND_ASSERT_MES(r, false, "Failed to validate_pos_coinbase_outs_unlock_time() in miner tx, block_id = " << get_block_hash(b)