Skip to content

Commit

Permalink
sdk: add gossip to Options
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 11, 2023
1 parent 2b273c9 commit ba57899
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/nostr-sdk/src/client/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ pub struct Options {
/// NIP46 timeout (default: 180 secs)
#[cfg(feature = "nip46")]
pub nip46_timeout: Option<Duration>,
/// Gossip (default: true)
pub gossip: bool,
/// Shutdown on [Client](super::Client) drop
pub shutdown_on_drop: bool,
/// Pool Options
Expand All @@ -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(),
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ba57899

Please sign in to comment.