This commit is contained in:
Igor Katson 2024-08-21 16:20:46 +01:00
parent ad5f62b9b9
commit 3067ad21d5
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 19 additions and 18 deletions

View file

@ -214,12 +214,16 @@ impl TorrentStateLive {
paused: TorrentStatePaused,
fatal_errors_tx: tokio::sync::oneshot::Sender<anyhow::Error>,
cancellation_token: CancellationToken,
session_stats: Arc<AtomicSessionStats>,
) -> anyhow::Result<Arc<Self>> {
let (peer_queue_tx, peer_queue_rx) = unbounded_channel();
let down_speed_estimator = SpeedEstimator::new(5);
let up_speed_estimator = SpeedEstimator::new(5);
let session = paused
.info
.session
.upgrade()
.context("session is dead, cannot start torrent")?;
let session_stats = session.stats.atomic.clone();
let down_speed_estimator = SpeedEstimator::default();
let up_speed_estimator = SpeedEstimator::default();
let have_bytes = paused.chunk_tracker.get_hns().have_bytes;
let lengths = *paused.chunk_tracker.get_lengths();