diff --git a/core/src/main/java/com/muwire/core/SharedFile.java b/core/src/main/java/com/muwire/core/SharedFile.java index 5813c133..7be6e7fd 100644 --- a/core/src/main/java/com/muwire/core/SharedFile.java +++ b/core/src/main/java/com/muwire/core/SharedFile.java @@ -20,6 +20,7 @@ public class SharedFile { private final File file; private final byte[] root; + private final InfoHash rootInfoHash; private final int pieceSize; private final String cachedPath; @@ -37,6 +38,7 @@ public class SharedFile { public SharedFile(File file, byte[] root, int pieceSize) throws IOException { this.file = file; this.root = root; + this.rootInfoHash = new InfoHash(root); this.pieceSize = pieceSize; this.cachedPath = file.getAbsolutePath(); this.cachedLength = file.length(); @@ -64,6 +66,8 @@ public class SharedFile { return root; } + public InfoHash getRootInfoHash() {return rootInfoHash;} + public int getPieceSize() { return pieceSize; } diff --git a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy index fc774634..32df64b6 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -361,7 +361,7 @@ class MainFrameView { closureColumn(header : trans("COMMENTS"), preferredWidth : 50, type : Boolean, read : {it.getComment() != null}) closureColumn(header : trans("CERTIFIED"), preferredWidth : 50, type : Boolean, read : { Core core = application.context.get("core") - core.certificateManager.hasLocalCertificate(new InfoHash(it.getRoot())) + core.certificateManager.hasLocalCertificate(it.getRootInfoHash()) }) closureColumn(header : trans("PUBLISHED"), preferredWidth : 50, type : Boolean, read : {row -> row.isPublished()}) closureColumn(header : trans("SEARCH_HITS"), preferredWidth: 50, type : Integer, read : {it.getHits()})