Rename a constant for consistency

This commit is contained in:
teor 2020-12-03 18:08:51 +10:00
parent 7f823e7c5a
commit 2d3c41f0af
2 changed files with 4 additions and 6 deletions

View File

@ -14,9 +14,7 @@ use crate::{PreparedBlock, ValidateContextError};
use super::check; use super::check;
use difficulty::{ use difficulty::{AdjustedDifficulty, POW_MEDIAN_BLOCK_SPAN, TESTNET_MAX_TIME_START_HEIGHT};
AdjustedDifficulty, BLOCK_MAX_TIME_TESTNET_ACTIVATION_HEIGHT, POW_MEDIAN_BLOCK_SPAN,
};
pub(crate) mod difficulty; pub(crate) mod difficulty;
@ -150,8 +148,8 @@ fn difficulty_threshold_is_valid(
})? })?
} }
// The maximum time rule is only active on Testnet from height 653606 onwards // The maximum time rule is only active on Testnet from a specific height
if (network == Network::Mainnet || candidate_height >= BLOCK_MAX_TIME_TESTNET_ACTIVATION_HEIGHT) if (network == Network::Mainnet || candidate_height >= TESTNET_MAX_TIME_START_HEIGHT)
&& candidate_time > block_time_max && candidate_time > block_time_max
{ {
Err(ValidateContextError::TimeTooLate { Err(ValidateContextError::TimeTooLate {

View File

@ -45,7 +45,7 @@ pub const BLOCK_MAX_TIME_SINCE_MEDIAN: i64 = 90 * 60;
/// The activation height for the block maximum time rule on Testnet. /// The activation height for the block maximum time rule on Testnet.
/// ///
/// Part of the block header consensus rules in the Zcash specification. /// Part of the block header consensus rules in the Zcash specification.
pub const BLOCK_MAX_TIME_TESTNET_ACTIVATION_HEIGHT: block::Height = block::Height(653606); pub const TESTNET_MAX_TIME_START_HEIGHT: block::Height = block::Height(653_606);
/// Contains the context needed to calculate the adjusted difficulty for a block. /// Contains the context needed to calculate the adjusted difficulty for a block.
pub(super) struct AdjustedDifficulty { pub(super) struct AdjustedDifficulty {