From 81e6188e4cb6158972041c9089c350534e2b7897 Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Sun, 15 Nov 2026 08:49:47 -0700 Subject: [PATCH] store: build the legacy unloadable rows' path only with sqlite-store --- crates/rns-transport/src/store/legacy.rs | 4 +++- crates/rns-transport/src/store/mod.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/rns-transport/src/store/legacy.rs b/crates/rns-transport/src/store/legacy.rs index 6c29ddb..e9b0a9f 100644 --- a/crates/rns-transport/src/store/legacy.rs +++ b/crates/rns-transport/src/store/legacy.rs @@ -27,8 +27,9 @@ pub struct LegacyImport { } /// A legacy known-destination row as upstream imports it (Storage.py -/// `import_legacy`), whatever the length of its public key. +/// `import_legacy`), whatever the length of its public key. Only a SQLite store keeps it. #[derive(Debug)] +#[cfg_attr(not(feature = "sqlite-store"), allow(dead_code))] pub(crate) struct RawKnownRow { pub(crate) destination_hash: DestHash, pub(crate) last_heard: f64, @@ -43,6 +44,7 @@ pub(crate) struct RawKnownRow { impl LegacyImport { /// Rows whose public key is not 64 bytes: the database keeps them, the table cannot load them. + #[cfg_attr(not(feature = "sqlite-store"), allow(dead_code))] pub(crate) fn unloadable(&self) -> &[RawKnownRow] { &self.unloadable } diff --git a/crates/rns-transport/src/store/mod.rs b/crates/rns-transport/src/store/mod.rs index fc1b304..76a2c5b 100644 --- a/crates/rns-transport/src/store/mod.rs +++ b/crates/rns-transport/src/store/mod.rs @@ -269,10 +269,12 @@ pub trait KnownDestinationStore: Send { } /// A store that keeps the legacy rows its table cannot load, as upstream's import does. +#[cfg(feature = "sqlite-store")] pub(crate) trait KeepUnloadable: KnownDestinationStore { fn keep_unloadable(&mut self, rows: &[legacy::RawKnownRow]) -> Result<(), StoreError>; } +#[cfg(feature = "sqlite-store")] impl KeepUnloadable for MemoryStore { /// Only a database holds them. fn keep_unloadable(&mut self, _rows: &[legacy::RawKnownRow]) -> Result<(), StoreError> {