From 78a52df0ec23a89141e7231fbb3f69ac0b33e8ff Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Mon, 13 Jan 2020 15:22:26 +0000 Subject: [PATCH] Assertion on maximum number of iterations --- validator/src/validator/health_check/result.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/validator/src/validator/health_check/result.rs b/validator/src/validator/health_check/result.rs index 120fb0ea16..e850c093e0 100644 --- a/validator/src/validator/health_check/result.rs +++ b/validator/src/validator/health_check/result.rs @@ -38,7 +38,15 @@ impl HealthCheckResult { HealthCheckResult(health) } - pub async fn calculate(topology: T, iterations: usize) -> Self { + pub async fn calculate( + topology: T, + iterations: usize, + resolution_timeout: Duration, + ) -> Self { + // currently healthchecker supports only up to 255 iterations - if we somehow + // find we need more, it's relatively easy change + assert!(iterations <= 255); + let all_paths = match topology.all_paths() { Ok(paths) => paths, Err(_) => return Self::zero_score(topology),