Skip to content

Commit

Permalink
Remove redundant closing of connection
Browse files Browse the repository at this point in the history
Fixes #4052, as the peer.close() already calls closeConnection if
a writeTarget is established successfully.
  • Loading branch information
ripcurlx committed Mar 12, 2020
1 parent 96934d9 commit e7a22f4
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
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 e7a22f4

Please sign in to comment.