diff --git a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy index f1c55980..b1fcbaf3 100644 --- a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy @@ -380,7 +380,7 @@ class ConnectionAcceptor { JsonOutput jsonOutput = new JsonOutput() sharedFiles.each { it.hit(browser, System.currentTimeMillis(), "Browse Host"); - int certificates = certificateManager.getByInfoHash(it.getInfoHash()).size() + int certificates = certificateManager.getByInfoHash(new InfoHash(it.getRoot())).size() def obj = ResultsSender.sharedFileToObj(it, false, certificates) def json = jsonOutput.toJson(obj) dos.writeShort((short)json.length()) diff --git a/core/src/main/groovy/com/muwire/core/filecert/CertificateManager.groovy b/core/src/main/groovy/com/muwire/core/filecert/CertificateManager.groovy index f60fed91..efc27634 100644 --- a/core/src/main/groovy/com/muwire/core/filecert/CertificateManager.groovy +++ b/core/src/main/groovy/com/muwire/core/filecert/CertificateManager.groovy @@ -70,7 +70,7 @@ class CertificateManager { } void onUICreateCertificateEvent(UICreateCertificateEvent e) { - InfoHash infoHash = e.sharedFile.getInfoHash() + InfoHash infoHash = new InfoHash(e.sharedFile.getRoot()) String name = e.sharedFile.getFile().getName() long timestamp = System.currentTimeMillis() diff --git a/core/src/main/groovy/com/muwire/core/files/FileManager.groovy b/core/src/main/groovy/com/muwire/core/files/FileManager.groovy index b206b89a..16864be7 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileManager.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileManager.groovy @@ -117,7 +117,7 @@ class FileManager { void onFileUnsharedEvent(FileUnsharedEvent e) { SharedFile sf = e.unsharedFile - InfoHash infoHash = sf.getInfoHash() + InfoHash infoHash = new InfoHash(sf.getRoot()) Set existing = rootToFiles.get(infoHash) if (existing != null) { existing.remove(sf) diff --git a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy index 76f732da..b79df77a 100644 --- a/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy +++ b/core/src/main/groovy/com/muwire/core/search/ResultsSender.groovy @@ -77,11 +77,11 @@ class ResultsSender { if (it.getComment() != null) { comment = DataUtil.readi18nString(Base64.decode(it.getComment())) } - int certificates = certificateManager.getByInfoHash(it.getInfoHash()).size() + int certificates = certificateManager.getByInfoHash(new InfoHash(it.getRoot())).size() def uiResultEvent = new UIResultEvent( sender : me, name : it.getFile().getName(), size : length, - infohash : it.getInfoHash(), + infohash : new InfoHash(it.getRoot()), pieceSize : pieceSize, uuid : uuid, browse : settings.browseFiles,