From fff534590bbae972d75fd5c84f81cf6c711f554e Mon Sep 17 00:00:00 2001 From: Hector Santos Date: Sat, 14 Sep 2024 11:29:32 +0200 Subject: [PATCH] Generate Location from local addresses properly --- crates/core/Cargo.toml | 1 + crates/core/src/ring.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 1e7dd4a07..a397c9c90 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -91,6 +91,7 @@ tracing = "0.1" [features] default = ["redb", "trace", "websocket"] local-mode = [] +local-simulation = [] network-mode = [] sqlite = ["sqlx"] trace = ["tracing-subscriber"] diff --git a/crates/core/src/ring.rs b/crates/core/src/ring.rs index 3eab7a523..50bd9554b 100644 --- a/crates/core/src/ring.rs +++ b/crates/core/src/ring.rs @@ -788,7 +788,7 @@ pub struct Location(f64); impl Location { - #[cfg(not(feature = "local-mode"))] + #[cfg(not(feature = "local-simulation"))] pub fn from_address(addr: &SocketAddr) -> Self { match addr.ip() { IpAddr::V4(ipv4) => { @@ -808,7 +808,7 @@ impl Location { } } - #[cfg(feature = "local-mode")] + #[cfg(feature = "local-simulation")] pub fn from_address(_addr: &SocketAddr) -> Self { let random_component: f64 = rand::random(); Location(random_component)