forked from lx/netapp
Tentative trace
This commit is contained in:
parent
a7d92689e0
commit
dbb15807b9
1 changed files with 2 additions and 0 deletions
|
@ -150,6 +150,7 @@ impl BasaltView {
|
|||
for peer in peers.iter() {
|
||||
let peer_cost = peer.cost(&self.slots[i].seed);
|
||||
if self.slots[i].peer.is_none() || peer_cost < slot_cost {
|
||||
trace!("Best match for slot {}: {}@{} (cost {})", i, hex::encode(peer.id), peer.addr, hex::encode(peer_cost));
|
||||
self.slots[i].peer = Some(*peer);
|
||||
slot_cost = peer_cost;
|
||||
}
|
||||
|
@ -212,6 +213,7 @@ impl BasaltView {
|
|||
|
||||
fn reset_some_slots(&mut self, count: usize) {
|
||||
for _i in 0..count {
|
||||
trace!("Reset slot {}", self.i_reset);
|
||||
self.slots[self.i_reset].seed = rand_seed();
|
||||
self.i_reset = (self.i_reset + 1) % self.slots.len();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue