From 52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 11 Dec 2025 16:45:34 +0000 Subject: sync: test sync works without negentropy and add disable option in sync --- src/sync/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/sync') diff --git a/src/sync/mod.rs b/src/sync/mod.rs index 3f3966a..c4c3c7f 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -511,8 +511,9 @@ impl SyncManager { } }; - // Check if relay supports NIP-77 negentropy - let use_negentropy = connection.supports_negentropy().await; + // Check if relay supports NIP-77 negentropy AND negentropy is not disabled + let use_negentropy = !self.config.sync_disable_negentropy + && connection.supports_negentropy().await; // Unsubscribe all current subscriptions connection.unsubscribe_all().await; @@ -948,7 +949,11 @@ impl SyncManager { ); // Check if relay supports NIP-77 negentropy for efficient sync - let use_negentropy = if let Some(connection) = self.connections.get(relay_url) { + // Respect the sync_disable_negentropy config option + let use_negentropy = if self.config.sync_disable_negentropy { + tracing::debug!(relay = %relay_url, "Negentropy disabled via config"); + false + } else if let Some(connection) = self.connections.get(relay_url) { connection.supports_negentropy().await } else { false -- cgit v1.2.3