mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: use exact max full peer count or round (#10228)
This commit is contained in:
@ -421,7 +421,7 @@ where
|
|||||||
|
|
||||||
// send full transactions to a fraction of the connected peers (square root of the total
|
// send full transactions to a fraction of the connected peers (square root of the total
|
||||||
// number of connected peers)
|
// number of connected peers)
|
||||||
let max_num_full = (self.peers.len() as f64).sqrt() as usize + 1;
|
let max_num_full = (self.peers.len() as f64).sqrt().round() as usize;
|
||||||
|
|
||||||
// Note: Assuming ~random~ order due to random state of the peers map hasher
|
// Note: Assuming ~random~ order due to random state of the peers map hasher
|
||||||
for (peer_idx, (peer_id, peer)) in self.peers.iter_mut().enumerate() {
|
for (peer_idx, (peer_id, peer)) in self.peers.iter_mut().enumerate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user