using sorted list of timestamps to evaluate median

This commit is contained in:
NikVolf 2016-11-25 16:54:56 +03:00
parent c4ab5e70ac
commit 2cdf526ee9
1 changed files with 2 additions and 1 deletions

View File

@ -288,7 +288,8 @@ impl ChainVerifier {
}
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])
}
else { None }