mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-08-02 00:31:24 +00:00
BuildCheckpoints: Fix possible resource leak.
This commit is contained in:
committed by
Andreas Schildbach
parent
a20087eee3
commit
c1abf2b7f4
@@ -193,7 +193,14 @@ public class BuildCheckpoints {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void sanityCheck(File file, int expectedSize) throws IOException {
|
private static void sanityCheck(File file, int expectedSize) throws IOException {
|
||||||
CheckpointManager manager = new CheckpointManager(params, new FileInputStream(file));
|
FileInputStream fis = new FileInputStream(file);
|
||||||
|
CheckpointManager manager;
|
||||||
|
try {
|
||||||
|
manager = new CheckpointManager(params, fis);
|
||||||
|
} finally {
|
||||||
|
fis.close();
|
||||||
|
}
|
||||||
|
|
||||||
checkState(manager.numCheckpoints() == expectedSize);
|
checkState(manager.numCheckpoints() == expectedSize);
|
||||||
|
|
||||||
if (params.getId().equals(NetworkParameters.ID_MAINNET)) {
|
if (params.getId().equals(NetworkParameters.ID_MAINNET)) {
|
||||||
|
Reference in New Issue
Block a user