mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-07-29 02:53:31 +00:00
fix(wallet): suggestions 3
This commit is contained in:
parent
8389f060c4
commit
277f641472
@ -103,7 +103,7 @@ impl MultiSequencerClient {
|
||||
.map(|conn| &conn.sequencer_addr)
|
||||
.all_unique()
|
||||
{
|
||||
anyhow::bail!("All adresses must be unique");
|
||||
anyhow::bail!("All addresses must be unique");
|
||||
}
|
||||
|
||||
let mut actualization_list = vec![];
|
||||
@ -669,16 +669,17 @@ fn choose_leaders(
|
||||
.expect("Ratios must be a valid numbers")
|
||||
});
|
||||
|
||||
res_vec = res_vec[..(res_vec
|
||||
.iter()
|
||||
.position(|item| {
|
||||
error_ratio(
|
||||
statistics.get(&item.0).unwrap().errors,
|
||||
statistics.get(&item.0).unwrap().sample_size,
|
||||
) > avg_err_ratio
|
||||
})
|
||||
.unwrap_or(res_vec.len()))]
|
||||
.to_vec();
|
||||
res_vec.truncate(
|
||||
res_vec
|
||||
.iter()
|
||||
.position(|item| {
|
||||
error_ratio(
|
||||
statistics.get(&item.0).unwrap().errors,
|
||||
statistics.get(&item.0).unwrap().sample_size,
|
||||
) > avg_err_ratio
|
||||
})
|
||||
.unwrap_or(res_vec.len()),
|
||||
);
|
||||
|
||||
// Choose clients with least latency and variance
|
||||
res_vec.sort_by(|a, b| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user