]> granicus.if.org Git - transmission/commitdiff
address dirty/save sequencing issue in prev commit
authorCharles Kerr <ckerr@github.com>
Sat, 2 Feb 2019 20:49:53 +0000 (14:49 -0600)
committerCharles Kerr <ckerr@github.com>
Sat, 2 Feb 2019 20:49:53 +0000 (14:49 -0600)
libtransmission/torrent.c

index 3ebaa665cbcb109e5cf818203fc983673ac1e714..a5cb82cce4d781f5ccf77fc986fa49da671bfd3a 100644 (file)
@@ -2318,23 +2318,21 @@ void tr_torrentRecheckCompleteness(tr_torrent* tor)
 
         fireCompletenessChange(tor, completeness, wasRunning);
 
-        if (tr_torrentIsSeed(tor))
+        if (tr_torrentIsSeed(tor) && wasLeeching && wasRunning)
         {
-            if (wasLeeching && wasRunning)
-            {
-                /* if completeness was TR_LEECH then the seed limit check will have been skipped in bandwidthPulse */
-                tr_torrentCheckSeedLimit(tor);
-            }
-
-            if (tr_sessionIsTorrentDoneScriptEnabled(tor->session))
-            {
-                tr_torrentSave(tor);
-
-                torrentCallScript(tor, tr_sessionGetTorrentDoneScript(tor->session));
-            }
+            /* if completeness was TR_LEECH, the seed limit check
+               will have been skipped in bandwidthPulse */
+            tr_torrentCheckSeedLimit(tor);
         }
 
         tr_torrentSetDirty(tor);
+
+        if (tr_torrentIsSeed(tor) && tr_sessionIsTorrentDoneScriptEnabled(tor->session))
+        {
+            tr_torrentSave(tor);
+
+            torrentCallScript(tor, tr_sessionGetTorrentDoneScript(tor->session));
+        }
     }
 
     tr_torrentUnlock(tor);