Pass back peers from Web UI when adding a magnet in attempt to speed it up

This commit is contained in:
Igor Katson 2023-12-01 09:30:23 +00:00
parent 21b1bd9e7d
commit f337ab1837
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
8 changed files with 77 additions and 27 deletions

View file

@ -29,6 +29,7 @@ use tracing::debug;
use tracing::error;
use tracing::error_span;
use tracing::warn;
use tracing::trace;
use url::Url;
use crate::chunk_tracker::ChunkTracker;
@ -207,6 +208,7 @@ impl ManagedTorrent {
{
let live: Arc<TorrentStateLive> =
live.upgrade().context("no longer live")?;
trace!("adding {} initial peers", initial_peers.len());
for peer in initial_peers {
live.add_peer_if_not_seen(peer).context("torrent closed")?;
}