fix: cover all pex disabled cases in `get_peer_candidate()` (#5806)

This commit is contained in:
tearfur 2023-08-14 22:56:43 +08:00 committed by GitHub
parent 2a51d4882c
commit 0c7992baa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -2321,10 +2321,10 @@ struct peer_candidate
continue;
}
/* if everyone in the swarm is seeds and pex is disabled because
* the torrent is private, then don't initiate connections */
/* if everyone in the swarm is seeds and pex is disabled,
* then don't initiate connections */
bool const seeding = tor->is_done();
if (seeding && swarm->is_all_seeds() && tor->is_private())
if (seeding && swarm->is_all_seeds() && !tor->allows_pex())
{
continue;
}