sync persisting of hashlist or hashroot for active downloads

pull/5/head
Zlatin Balevsky 2019-06-12 22:39:00 +01:00
parent 658d9cf5a8
commit ca3f2513e1
2 changed files with 5 additions and 4 deletions

View File

@ -124,10 +124,11 @@ public class DownloadManager {
} }
json.destinations = destinations json.destinations = destinations
if (downloader.infoHash.hashList != null) InfoHash infoHash = downloader.getInfoHash()
json.hashList = Base64.encode(downloader.infoHash.hashList) if (infoHash.hashList != null)
json.hashList = Base64.encode(infoHash.hashList)
else else
json.hashRoot = Base64.encode(downloader.infoHash.getRoot()) json.hashRoot = Base64.encode(infoHash.getRoot())
writer.println(JsonOutput.toJson(json)) writer.println(JsonOutput.toJson(json))
} }
} }

View File

@ -76,7 +76,7 @@ public class Downloader {
claimed = new Pieces(nPieces) claimed = new Pieces(nPieces)
} }
private synchronized InfoHash getInfoHash() { public synchronized InfoHash getInfoHash() {
infoHash infoHash
} }