reformat exception handling

This commit is contained in:
Dominykas Mostauskis 2020-03-13 16:16:50 +01:00
parent ba229cf5d2
commit f5253c885f
No known key found for this signature in database
GPG key ID: 97B407C08F2499EB

View file

@ -249,13 +249,13 @@ public class LocalBitcoinNode {
try { try {
var peerVersionMessage = peerVersionMessageFuture.get(HANDSHAKE_TIMEOUT, TimeUnit.MILLISECONDS); var peerVersionMessage = peerVersionMessageFuture.get(HANDSHAKE_TIMEOUT, TimeUnit.MILLISECONDS);
optionalPeerVersionMessage = Optional.of(peerVersionMessage); optionalPeerVersionMessage = Optional.of(peerVersionMessage);
} catch (ExecutionException | InterruptedException | CancellationException | TimeoutException ex) { } catch (ExecutionException | InterruptedException | CancellationException ex) {
optionalPeerVersionMessage = Optional.empty(); optionalPeerVersionMessage = Optional.empty();
if (ex instanceof TimeoutException) { } catch (TimeoutException ex) {
log.error("Exploratory handshake attempt with a local Bitcoin node (that may not be there)" + optionalPeerVersionMessage = Optional.empty();
" unexpectedly timed out. This should never happen; please report this. HANDSHAKE_TIMEOUT" + log.error("Exploratory handshake attempt with a local Bitcoin node (that may not be there)" +
" is {} ms. Continuing as if a local BTC node was not found.", HANDSHAKE_TIMEOUT); " unexpectedly timed out. This should never happen; please report this. HANDSHAKE_TIMEOUT" +
} " is {} ms. Continuing as if a local BTC node was not found.", HANDSHAKE_TIMEOUT);
} }
peer.close(); peer.close();