mirror of https://github.com/zlatinb/muwire
sync persisting of hashlist or hashroot for active downloads
parent
658d9cf5a8
commit
ca3f2513e1
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue