Remove unnecessary initial_peers merging code

This commit is contained in:
Igor Katson 2024-12-07 12:06:06 +00:00
parent e4845e2368
commit afca0fbbe3
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
2 changed files with 1 additions and 15 deletions

View file

@ -1167,20 +1167,6 @@ impl Session {
}
}
// Merge "initial_peers" and "peer_rx" into one stream.
let peer_rx = merge_two_optional_streams(
if !seen_peers.is_empty() {
debug!(
count = seen_peers.len(),
"merging initial peers into peer_rx"
);
Some(futures::stream::iter(seen_peers.into_iter()))
} else {
None
},
peer_rx,
);
let _e = managed_torrent.shared.span.clone().entered();
managed_torrent
.start(peer_rx, opts.paused)

View file

@ -400,7 +400,7 @@ impl ManagedTorrent {
}
if !start_paused && peer_rx.is_none() {
bail!("logic bug: start(start_paused=true, peer_rx=None) called. peer_rx must be set if starting the torrent")
bail!("logic bug: start(start_paused=false, peer_rx=None) called. peer_rx must be set if starting the torrent")
}
let session = self