Still sending to all peers to avoid timeouts

This commit is contained in:
Dennis Schwerdel 2015-11-20 13:39:57 +01:00
parent 58f4d58d66
commit d3bcfbec5e
1 changed files with 2 additions and 4 deletions

View File

@ -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;