use previous block index in deployments state

This commit is contained in:
Svyatoslav Nikolsky 2017-08-22 14:28:06 +03:00
parent a1034cf623
commit f4fb8fde23
1 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,8 @@ impl<'a> BlockDeployments<'a> {
/// Calculates threshold state of given deployment
fn threshold_state(cache: &mut DeploymentStateCache, deployment: Deployment, number: u32, headers: &BlockHeaderProvider, consensus: &ConsensusParams) -> ThresholdState {
// deployments are checked using previous block index
let number = number - 1;
if let Some(activation) = deployment.activation {
if activation <= number {
return ThresholdState::Active;
@ -162,7 +164,6 @@ fn threshold_state(cache: &mut DeploymentStateCache, deployment: Deployment, num
result
},
}
}
fn first_of_the_period(block: u32, miner_confirmation_window: u32) -> u32 {