From 221c3629e44b67ab37e52db39d594367782cef2a Mon Sep 17 00:00:00 2001 From: CalDescent Date: Fri, 11 Mar 2022 13:08:37 +0000 Subject: [PATCH] Don't refetch the file list if the fileListCache is empty, since an empty list now means that there are likely to be no files available on disk. --- .../java/org/qortal/repository/BlockArchiveReader.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/qortal/repository/BlockArchiveReader.java b/src/main/java/org/qortal/repository/BlockArchiveReader.java index fa7fad26..83508152 100644 --- a/src/main/java/org/qortal/repository/BlockArchiveReader.java +++ b/src/main/java/org/qortal/repository/BlockArchiveReader.java @@ -67,7 +67,7 @@ public class BlockArchiveReader { } public Triple, List> fetchBlockAtHeight(int height) { - if (this.fileListCache == null || this.fileListCache.isEmpty()) { + if (this.fileListCache == null) { this.fetchFileList(); } @@ -94,7 +94,7 @@ public class BlockArchiveReader { public Triple, List> fetchBlockWithSignature( byte[] signature, Repository repository) { - if (this.fileListCache == null || this.fileListCache.isEmpty()) { + if (this.fileListCache == null) { this.fetchFileList(); } @@ -145,7 +145,7 @@ public class BlockArchiveReader { } private String getFilenameForHeight(int height) { - if (this.fileListCache == null || this.fileListCache.isEmpty()) { + if (this.fileListCache == null) { this.fetchFileList(); } @@ -170,7 +170,7 @@ public class BlockArchiveReader { } public byte[] fetchSerializedBlockBytesForSignature(byte[] signature, boolean includeHeightPrefix, Repository repository) { - if (this.fileListCache == null || this.fileListCache.isEmpty()) { + if (this.fileListCache == null) { this.fetchFileList(); }