#5407: In `tr_peerMgrGetDesiredAvailable()`, check if swarm is running (suggested by x190)
This commit is contained in:
parent
7d30ad3ff6
commit
de304e8a35
|
@ -2619,17 +2619,12 @@ tr_peerMgrGetDesiredAvailable (const tr_torrent * tor)
|
|||
|
||||
/* common shortcuts... */
|
||||
|
||||
if (!tor->isRunning || tor->isStopping)
|
||||
return 0;
|
||||
|
||||
if (tr_torrentIsSeed (tor))
|
||||
return 0;
|
||||
|
||||
if (!tr_torrentHasMetadata (tor))
|
||||
if (!tor->isRunning || tor->isStopping ||
|
||||
tr_torrentIsSeed (tor) || !tr_torrentHasMetadata (tor))
|
||||
return 0;
|
||||
|
||||
s = tor->swarm;
|
||||
if (s == NULL)
|
||||
if (s == NULL || !s->isRunning)
|
||||
return 0;
|
||||
|
||||
n = tr_ptrArraySize (&s->peers);
|
||||
|
|
Loading…
Reference in New Issue