Skip to content

Commit

Permalink
chore(node): extend distance range
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Apr 3, 2024
1 parent 568e68a commit 10acc17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sn_networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,11 @@ impl SwarmDriver {

let our_address = NetworkAddress::from_peer(self.self_peer_id);

// get REPLICATE_RANGE + 2 peer's address distance
// get REPLICATE_RANGE + 2 peer's address distance
// This is a rough estimate of the farthest address we might be responsible for.
// We want this to be higher than actually necessary, so we retain more data
// and can be sure to pass bad node checks
if let Some(peer) = closest_k_peers.get(REPLICATE_RANGE) {
if let Some(peer) = closest_k_peers.get(REPLICATE_RANGE + 2) {
let address = NetworkAddress::from_peer(*peer);
let distance = our_address.distance(&address);
farthest_distance = Some(distance);
Expand Down

0 comments on commit 10acc17

Please sign in to comment.