i2psnark: Fix autostart to start only torrents running previously,

save torrent running status on torrent stop when autostart is enabled,
remove dup call to startTorrent()
(ticket #2120)
This commit is contained in:
zzz
2019-08-04 20:29:46 +00:00
parent 49af26d958
commit 397bf43147
4 changed files with 19 additions and 5 deletions

View File

@@ -648,7 +648,10 @@ public class Snark
// TODO: Cache the config-in-mem to compare vs config-on-disk
// (needed for auto-save to not double-save in some cases)
long nowUploaded = getUploaded();
boolean changed = storage.isChanged() || nowUploaded != savedUploaded;
// If autoStart is enabled, always save the config, so we know
// whether to start it up next time
boolean changed = storage.isChanged() || nowUploaded != savedUploaded ||
(completeListener != null && completeListener.shouldAutoStart());
try {
storage.close();
} catch (IOException ioe) {