mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Use try-with-resources
This commit is contained in:
parent
3554e19084
commit
499d7b7d35
1 changed files with 1 additions and 4 deletions
|
@ -341,8 +341,7 @@ public class WalletConfig extends AbstractIdleService {
|
|||
|
||||
private Wallet loadWallet(boolean shouldReplayWallet, File walletFile, boolean isBsqWallet) throws Exception {
|
||||
Wallet wallet;
|
||||
FileInputStream walletStream = new FileInputStream(walletFile);
|
||||
try {
|
||||
try (FileInputStream walletStream = new FileInputStream(walletFile)) {
|
||||
WalletExtension[] extArray = new WalletExtension[]{};
|
||||
Protos.Wallet proto = WalletProtobufSerializer.parseToProto(walletStream);
|
||||
final WalletProtobufSerializer serializer;
|
||||
|
@ -360,8 +359,6 @@ public class WalletConfig extends AbstractIdleService {
|
|||
.accountPath(new BisqKeyChainGroupStructure(isBsqWallet).accountPathFor(Script.ScriptType.P2WPKH)).build();
|
||||
wallet.addAndActivateHDChain(nativeSegwitKeyChain);
|
||||
}
|
||||
} finally {
|
||||
walletStream.close();
|
||||
}
|
||||
return wallet;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue