mirror of https://github.com/dswd/vpncloud.git
Still sending to all peers to avoid timeouts
This commit is contained in:
parent
58f4d58d66
commit
d3bcfbec5e
|
@ -237,11 +237,9 @@ impl EthCloud {
|
||||||
peer_num = 10;
|
peer_num = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut seed = precise_time_ns() as u32;
|
let peers = self.peers.subset(peer_num, precise_time_ns() as u32);
|
||||||
let peers = self.peers.subset(peer_num, seed);
|
|
||||||
let msg = udpmessage::Message::Peers(peers);
|
let msg = udpmessage::Message::Peers(peers);
|
||||||
seed ^= (precise_time_ns() >> 32) as u32;
|
for addr in &self.peers.as_vec() {
|
||||||
for addr in &self.peers.subset(peer_num, seed) {
|
|
||||||
try!(self.send_msg(addr, &msg));
|
try!(self.send_msg(addr, &msg));
|
||||||
}
|
}
|
||||||
self.next_peerlist = SteadyTime::now() + self.update_freq;
|
self.next_peerlist = SteadyTime::now() + self.update_freq;
|
||||||
|
|
Loading…
Reference in New Issue