diff --git a/crates/nostr-sdk/src/client/options.rs b/crates/nostr-sdk/src/client/options.rs index c8e9aeac0..2bb0b93ee 100644 --- a/crates/nostr-sdk/src/client/options.rs +++ b/crates/nostr-sdk/src/client/options.rs @@ -37,6 +37,8 @@ pub struct Options { /// NIP46 timeout (default: 180 secs) #[cfg(feature = "nip46")] pub nip46_timeout: Option, + /// Gossip (default: true) + pub gossip: bool, /// Shutdown on [Client](super::Client) drop pub shutdown_on_drop: bool, /// Pool Options @@ -56,6 +58,7 @@ impl Default for Options { send_timeout: Some(DEFAULT_SEND_TIMEOUT), #[cfg(feature = "nip46")] nip46_timeout: Some(Duration::from_secs(180)), + gossip: true, shutdown_on_drop: false, pool: RelayPoolOptions::default(), } @@ -166,6 +169,14 @@ impl Options { } } + /// Gossip + pub fn gossip(self, value: bool) -> Self { + Self { + gossip: value, + ..self + } + } + /// Shutdown client on drop pub fn shutdown_on_drop(self, value: bool) -> Self { Self {