Since call-sites are calling unwrap anyways, panicking seems too punitive
for our use cases.
(cherry picked from commit 7cb3b6cbe2
)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
@ -326,7 +326,7 @@ pub fn new_cluster_nodes<T: 'static>(
|
||||
.collect();
|
||||
let broadcast = TypeId::of::<T>() == TypeId::of::<BroadcastStage>();
|
||||
let stakes: Vec<u64> = nodes.iter().map(|node| node.stake).collect();
|
||||
let mut weighted_shuffle = WeightedShuffle::new(&stakes).unwrap();
|
||||
let mut weighted_shuffle = WeightedShuffle::new("cluster-nodes", &stakes);
|
||||
if broadcast {
|
||||
weighted_shuffle.remove_index(index[&self_pubkey]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user