Tentative trace

This commit is contained in:
Alex 2020-12-11 20:04:49 +01:00
parent a7d92689e0
commit dbb15807b9

View file

@ -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();
}