mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Use try with resource.
This commit is contained in:
parent
ac78f72c1e
commit
175899486e
1 changed files with 1 additions and 10 deletions
|
@ -435,9 +435,7 @@ public class BisqSetup {
|
||||||
step3();
|
step3();
|
||||||
} else {
|
} else {
|
||||||
Thread checkIfLocalHostNodeIsRunningThread = new Thread(() -> {
|
Thread checkIfLocalHostNodeIsRunningThread = new Thread(() -> {
|
||||||
Socket socket = null;
|
try (Socket socket = new Socket()) {
|
||||||
try {
|
|
||||||
socket = new Socket();
|
|
||||||
socket.connect(new InetSocketAddress(InetAddresses.forString("127.0.0.1"),
|
socket.connect(new InetSocketAddress(InetAddresses.forString("127.0.0.1"),
|
||||||
BisqEnvironment.getBaseCurrencyNetwork().getParameters().getPort()), 5000);
|
BisqEnvironment.getBaseCurrencyNetwork().getParameters().getPort()), 5000);
|
||||||
log.info("Localhost Bitcoin node detected.");
|
log.info("Localhost Bitcoin node detected.");
|
||||||
|
@ -447,13 +445,6 @@ public class BisqSetup {
|
||||||
});
|
});
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
UserThread.execute(BisqSetup.this::step3);
|
UserThread.execute(BisqSetup.this::step3);
|
||||||
} finally {
|
|
||||||
if (socket != null) {
|
|
||||||
try {
|
|
||||||
socket.close();
|
|
||||||
} catch (IOException ignore) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, "checkIfLocalHostNodeIsRunningThread");
|
}, "checkIfLocalHostNodeIsRunningThread");
|
||||||
checkIfLocalHostNodeIsRunningThread.start();
|
checkIfLocalHostNodeIsRunningThread.start();
|
||||||
|
|
Loading…
Add table
Reference in a new issue