diff --git a/core/src/main/groovy/com/muwire/core/download/Downloader.groovy b/core/src/main/groovy/com/muwire/core/download/Downloader.groovy index 402138c5..6e80ebba 100644 --- a/core/src/main/groovy/com/muwire/core/download/Downloader.groovy +++ b/core/src/main/groovy/com/muwire/core/download/Downloader.groovy @@ -180,6 +180,7 @@ public class Downloader { piecesFile.delete() } incompleteFile.delete() + pieces.clearAll() } void stop() { diff --git a/core/src/main/groovy/com/muwire/core/download/Pieces.groovy b/core/src/main/groovy/com/muwire/core/download/Pieces.groovy index 243c1c14..1d947d76 100644 --- a/core/src/main/groovy/com/muwire/core/download/Pieces.groovy +++ b/core/src/main/groovy/com/muwire/core/download/Pieces.groovy @@ -78,4 +78,9 @@ class Pieces { synchronized boolean isDownloaded(int piece) { done.get(piece) } + + synchronized void clearAll() { + done.clear() + claimed.clear() + } }