using sorted list of timestamps to evaluate median
This commit is contained in:
parent
c4ab5e70ac
commit
2cdf526ee9
|
@ -288,7 +288,8 @@ impl ChainVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
if timestamps.len() > 2 {
|
if timestamps.len() > 2 {
|
||||||
let timestamps: Vec<_> = timestamps.into_iter().collect();
|
let mut timestamps: Vec<_> = timestamps.into_iter().collect();
|
||||||
|
timestamps.sort();
|
||||||
Some(timestamps[timestamps.len() / 2])
|
Some(timestamps[timestamps.len() / 2])
|
||||||
}
|
}
|
||||||
else { None }
|
else { None }
|
||||||
|
|
Loading…
Reference in New Issue