From f4fb8fde23f6c64d9048cd2cc1f296604565656b Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 22 Aug 2017 14:28:06 +0300 Subject: [PATCH] use previous block index in deployments state --- verification/src/deployments.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/verification/src/deployments.rs b/verification/src/deployments.rs index 4a6902e3..6077b8b8 100644 --- a/verification/src/deployments.rs +++ b/verification/src/deployments.rs @@ -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 {