Skip to content

Commit

Permalink
Merge pull request #4056 from ripcurlx/fix-connection-closing-of-core…
Browse files Browse the repository at this point in the history
…-node-detection

Remove redundant closing of connection
  • Loading branch information
sqrrm authored Mar 13, 2020
2 parents 96934d9 + e7a22f4 commit 5a2d153
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,10 @@ private Optional<VersionMessage> 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();
Expand All @@ -251,7 +250,6 @@ private Optional<VersionMessage> attemptHandshakeForVersionMessage() {
}

peer.close();
client.closeConnection();

restoreLoggerLevel(NioClient.class, originalNioClientLoggerLevel);
restoreLoggerLevel(NioClientManager.class, originalNioClientManagerLoggerLevel);
Expand Down

0 comments on commit 5a2d153

Please sign in to comment.