From 10acc176e7d8790d7f7bd3b7834008c73a33d915 Mon Sep 17 00:00:00 2001 From: qima Date: Wed, 3 Apr 2024 19:20:34 +0800 Subject: [PATCH] chore(node): extend distance range --- sn_networking/src/driver.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sn_networking/src/driver.rs b/sn_networking/src/driver.rs index 90fba56a97..e6379738c9 100644 --- a/sn_networking/src/driver.rs +++ b/sn_networking/src/driver.rs @@ -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);