3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

Close the FileInputStream created in Wallet.loadFromFile(). Resolves issue 198.

This commit is contained in:
Mike Hearn 2012-06-03 11:35:22 +02:00
parent 80f141cbf5
commit 417dcefa67

View File

@ -224,7 +224,12 @@ public class Wallet implements Serializable {
* Returns a wallet deserialized from the given file.
*/
public static Wallet loadFromFile(File f) throws IOException {
return loadFromFileStream(new FileInputStream(f));
FileInputStream stream = new FileInputStream(f);
try {
return loadFromFileStream(stream);
} finally {
stream.close();
}
}
public boolean isConsistent() {