upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-11 16:45:34 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-11 16:46:01 +0000
commit52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 (patch)
tree9be147a22a95b7634a8120a60f2cd8899805088a /src/sync
parent6d0447f31eb9f9282e60ac3c90c665a8b3781331 (diff)
sync: test sync works without negentropy and add disable option in sync
Diffstat (limited to 'src/sync')
-rw-r--r--src/sync/mod.rs11
1 files changed, 8 insertions, 3 deletions
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 {
511 } 511 }
512 }; 512 };
513 513
514 // Check if relay supports NIP-77 negentropy 514 // Check if relay supports NIP-77 negentropy AND negentropy is not disabled
515 let use_negentropy = connection.supports_negentropy().await; 515 let use_negentropy = !self.config.sync_disable_negentropy
516 && connection.supports_negentropy().await;
516 517
517 // Unsubscribe all current subscriptions 518 // Unsubscribe all current subscriptions
518 connection.unsubscribe_all().await; 519 connection.unsubscribe_all().await;
@@ -948,7 +949,11 @@ impl SyncManager {
948 ); 949 );
949 950
950 // Check if relay supports NIP-77 negentropy for efficient sync 951 // Check if relay supports NIP-77 negentropy for efficient sync
951 let use_negentropy = if let Some(connection) = self.connections.get(relay_url) { 952 // Respect the sync_disable_negentropy config option
953 let use_negentropy = if self.config.sync_disable_negentropy {
954 tracing::debug!(relay = %relay_url, "Negentropy disabled via config");
955 false
956 } else if let Some(connection) = self.connections.get(relay_url) {
952 connection.supports_negentropy().await 957 connection.supports_negentropy().await
953 } else { 958 } else {
954 false 959 false