Rename a constant for consistency
This commit is contained in:
parent
7f823e7c5a
commit
2d3c41f0af
|
@ -14,9 +14,7 @@ use crate::{PreparedBlock, ValidateContextError};
|
|||
|
||||
use super::check;
|
||||
|
||||
use difficulty::{
|
||||
AdjustedDifficulty, BLOCK_MAX_TIME_TESTNET_ACTIVATION_HEIGHT, POW_MEDIAN_BLOCK_SPAN,
|
||||
};
|
||||
use difficulty::{AdjustedDifficulty, POW_MEDIAN_BLOCK_SPAN, TESTNET_MAX_TIME_START_HEIGHT};
|
||||
|
||||
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
|
||||
if (network == Network::Mainnet || candidate_height >= BLOCK_MAX_TIME_TESTNET_ACTIVATION_HEIGHT)
|
||||
// The maximum time rule is only active on Testnet from a specific height
|
||||
if (network == Network::Mainnet || candidate_height >= TESTNET_MAX_TIME_START_HEIGHT)
|
||||
&& candidate_time > block_time_max
|
||||
{
|
||||
Err(ValidateContextError::TimeTooLate {
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
/// 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.
|
||||
pub(super) struct AdjustedDifficulty {
|
||||
|
|
Loading…
Reference in New Issue