From e7a22f48db7d9634b420b699731d45c9dfb7888c Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Thu, 12 Mar 2020 17:52:27 +0100 Subject: [PATCH] Remove redundant closing of connection Fixes #4052, as the peer.close() already calls closeConnection if a writeTarget is established successfully. --- core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java b/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java index fcb250a07ae..2017e0b82df 100644 --- a/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java +++ b/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java @@ -229,11 +229,10 @@ private Optional attemptHandshakeForVersionMessage() { var originalNioClientLoggerLevel = silence(NioClient.class); var originalNioClientManagerLoggerLevel = silence(NioClientManager.class); - NioClient client; try { log.info("Initiating attempt to connect to and handshake with a local " + "Bitcoin node (which may or may not be running) on port {}.", port); - client = createClient(peer, port, CONNECTION_TIMEOUT); + createClient(peer, port, CONNECTION_TIMEOUT); } catch (IOException ex) { log.error("Local bitcoin node handshake attempt was unexpectedly interrupted", ex); return Optional.empty(); @@ -251,7 +250,6 @@ private Optional attemptHandshakeForVersionMessage() { } peer.close(); - client.closeConnection(); restoreLoggerLevel(NioClient.class, originalNioClientLoggerLevel); restoreLoggerLevel(NioClientManager.class, originalNioClientManagerLoggerLevel);