Skip to content

Commit

Permalink
restore collect
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsutton committed Jan 7, 2024
1 parent aed9106 commit b68e237
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion protocol/p2p/src/core/hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ impl Hub {
let peers = self.peers.read().values().cloned().collect::<Vec<_>>();
// TODO: At least some of the peers should be outbound, because an attacker can gain less control
// over the set of outbound peers.
for router in peers.choose_multiple(&mut rand::thread_rng(), num_peers) {
let peers = peers.choose_multiple(&mut rand::thread_rng(), num_peers).cloned().collect::<Vec<_>>();
for router in peers {
let _ = router.enqueue(msg.clone()).await;
}
}
Expand Down

0 comments on commit b68e237

Please sign in to comment.