Assertion on maximum number of iterations

This commit is contained in:
Jedrzej Stuczynski
2020-01-13 15:22:26 +00:00
parent 0ecab55959
commit 78a52df0ec
@@ -38,7 +38,15 @@ impl HealthCheckResult {
HealthCheckResult(health)
}
pub async fn calculate<T: NymTopology>(topology: T, iterations: usize) -> Self {
pub async fn calculate<T: NymTopology>(
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),