diff --git a/core/src/main/groovy/com/muwire/core/download/DownloadManager.groovy b/core/src/main/groovy/com/muwire/core/download/DownloadManager.groovy index 4d7e2f9f..fbb51e58 100644 --- a/core/src/main/groovy/com/muwire/core/download/DownloadManager.groovy +++ b/core/src/main/groovy/com/muwire/core/download/DownloadManager.groovy @@ -124,10 +124,11 @@ public class DownloadManager { } json.destinations = destinations - if (downloader.infoHash.hashList != null) - json.hashList = Base64.encode(downloader.infoHash.hashList) + InfoHash infoHash = downloader.getInfoHash() + if (infoHash.hashList != null) + json.hashList = Base64.encode(infoHash.hashList) else - json.hashRoot = Base64.encode(downloader.infoHash.getRoot()) + json.hashRoot = Base64.encode(infoHash.getRoot()) writer.println(JsonOutput.toJson(json)) } } 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 1ae0f774..67396f57 100644 --- a/core/src/main/groovy/com/muwire/core/download/Downloader.groovy +++ b/core/src/main/groovy/com/muwire/core/download/Downloader.groovy @@ -76,7 +76,7 @@ public class Downloader { claimed = new Pieces(nPieces) } - private synchronized InfoHash getInfoHash() { + public synchronized InfoHash getInfoHash() { infoHash }