diff options
Diffstat (limited to 'src/sync')
| -rw-r--r-- | src/sync/mod.rs | 11 |
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 |