Store initial_peers in state
This commit is contained in:
parent
e22132bba0
commit
8131ba0482
2 changed files with 4 additions and 1 deletions
|
|
@ -1179,6 +1179,7 @@ impl Session {
|
||||||
output_folder,
|
output_folder,
|
||||||
disk_write_queue: self.disk_write_tx.clone(),
|
disk_write_queue: self.disk_write_tx.clone(),
|
||||||
ratelimits: opts.ratelimits,
|
ratelimits: opts.ratelimits,
|
||||||
|
initial_peers: opts.initial_peers.clone().unwrap_or_default(),
|
||||||
#[cfg(feature = "disable-upload")]
|
#[cfg(feature = "disable-upload")]
|
||||||
_disable_upload: self._disable_upload,
|
_disable_upload: self._disable_upload,
|
||||||
},
|
},
|
||||||
|
|
@ -1391,7 +1392,7 @@ impl Session {
|
||||||
handle.shared().trackers.clone().into_iter().collect(),
|
handle.shared().trackers.clone().into_iter().collect(),
|
||||||
true,
|
true,
|
||||||
handle.shared().options.force_tracker_interval,
|
handle.shared().options.force_tracker_interval,
|
||||||
Default::default(),
|
handle.shared().options.initial_peers.clone(),
|
||||||
)?;
|
)?;
|
||||||
handle.start(peer_rx, false)?;
|
handle.start(peer_rx, false)?;
|
||||||
self.try_update_persistence_metadata(handle).await;
|
self.try_update_persistence_metadata(handle).await;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ mod streaming;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
use std::net::SocketAddr;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
@ -105,6 +106,7 @@ pub(crate) struct ManagedTorrentOptions {
|
||||||
pub output_folder: PathBuf,
|
pub output_folder: PathBuf,
|
||||||
pub disk_write_queue: Option<DiskWorkQueueSender>,
|
pub disk_write_queue: Option<DiskWorkQueueSender>,
|
||||||
pub ratelimits: LimitsConfig,
|
pub ratelimits: LimitsConfig,
|
||||||
|
pub initial_peers: Vec<SocketAddr>,
|
||||||
#[cfg(feature = "disable-upload")]
|
#[cfg(feature = "disable-upload")]
|
||||||
pub _disable_upload: bool,
|
pub _disable_upload: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue