static void
verifyTorrent( void * vtor )
{
+ bool startAfter;
tr_torrent * tor = vtor;
tr_sessionLock( tor->session );
/* if the torrent's already being verified, stop it */
tr_verifyRemove( tor );
- /* if the torrent's running, stop it & set the restart-after-verify flag */
- if( tor->startAfterVerify || tor->isRunning ) {
- /* don't clobber isStopping */
- const bool startAfter = tor->isStopping ? false : true;
+ startAfter = (tor->isRunning || tor->startAfterVerify) && !tor->isStopping;
+
+ if( tor->isRunning )
tr_torrentStop( tor );
- tor->startAfterVerify = startAfter;
- }
+
+ tor->startAfterVerify = startAfter;
if( setLocalErrorIfFilesDisappeared( tor ) )
tor->startAfterVerify = false;