mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
BuildCheckpoints: Fix possible resource leak.
This commit is contained in:
parent
40c26b58bd
commit
759156c71b
@ -211,7 +211,14 @@ public class BuildCheckpoints {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (params.getId().equals(NetworkParameters.ID_MAINNET)) {
|
||||
|
Loading…
Reference in New Issue
Block a user