1
0
Fork 0
forked from lthn/blockchain

putting back validation of max_related_block_height

This commit is contained in:
cryptozoidberg 2024-02-03 16:03:18 +01:00
parent 6ba6b55d46
commit 252297fecd
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC

View file

@ -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)