forked from Qortal/qortal
Fixed errors found in unit tests.
This commit is contained in:
parent
6ee7e9d731
commit
1f79d88840
@ -761,7 +761,7 @@ public class BlocksResource {
|
|||||||
|
|
||||||
// Use the latest X blocks if only a count is specified
|
// Use the latest X blocks if only a count is specified
|
||||||
if (startHeight == null && endHeight == null && count != null) {
|
if (startHeight == null && endHeight == null && count != null) {
|
||||||
BlockData chainTip = Controller.getInstance().getChainTip();
|
BlockData chainTip = repository.getBlockRepository().getLastBlock();
|
||||||
startHeight = chainTip.getHeight() - count;
|
startHeight = chainTip.getHeight() - count;
|
||||||
endHeight = chainTip.getHeight();
|
endHeight = chainTip.getHeight();
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ public class BlockArchiveReader {
|
|||||||
String[] files = archiveDirFile.list();
|
String[] files = archiveDirFile.list();
|
||||||
Map<String, Triple<Integer, Integer, Integer>> map = new HashMap<>();
|
Map<String, Triple<Integer, Integer, Integer>> map = new HashMap<>();
|
||||||
|
|
||||||
|
if (files != null) {
|
||||||
for (String file : files) {
|
for (String file : files) {
|
||||||
Path filePath = Paths.get(file);
|
Path filePath = Paths.get(file);
|
||||||
String filename = filePath.getFileName().toString();
|
String filename = filePath.getFileName().toString();
|
||||||
@ -63,6 +64,7 @@ public class BlockArchiveReader {
|
|||||||
Integer range = endHeight - startHeight;
|
Integer range = endHeight - startHeight;
|
||||||
map.put(filename, new Triple(startHeight, endHeight, range));
|
map.put(filename, new Triple(startHeight, endHeight, range));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.fileListCache = map;
|
this.fileListCache = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user