mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-22 22:25:41 +01:00
BuildCheckpoints: Fix possible resource leak.
This commit is contained in:
parent
40c26b58bd
commit
759156c71b
1 changed files with 8 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue