diff --git a/p2p/src/main/java/bisq/network/p2p/network/Connection.java b/p2p/src/main/java/bisq/network/p2p/network/Connection.java index bdd596a649..0396621a6a 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/Connection.java +++ b/p2p/src/main/java/bisq/network/p2p/network/Connection.java @@ -707,10 +707,10 @@ public class Connection implements HasCapabilities, Runnable, MessageListener { @Override public void run() { try { - Thread.currentThread().setName("InputHandler"); + Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(uid, 10)); while (!stopped && !Thread.currentThread().isInterrupted()) { if (!threadNameSet && getPeersNodeAddressOptional().isPresent()) { - Thread.currentThread().setName("InputHandler-" + getPeersNodeAddressOptional().get().getFullAddress()); + Thread.currentThread().setName("InputHandler-" + Utilities.toTruncatedString(getPeersNodeAddressOptional().get().getFullAddress(), 10)); threadNameSet = true; } try { diff --git a/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java b/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java index 4401347f67..86ed00c846 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java +++ b/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java @@ -141,8 +141,7 @@ public abstract class NetworkNode implements MessageListener { SettableFuture resultFuture = SettableFuture.create(); ListenableFuture future = connectionExecutor.submit(() -> { - Thread.currentThread().setName("NetworkNode.connectionExecutor:SendMessage-to-" + peersNodeAddress.getFullAddress()); - + Thread.currentThread().setName("NetworkNode.connectionExecutor:SendMessage-to-" + Utilities.toTruncatedString(peersNodeAddress.getFullAddress(), 10)); if (peersNodeAddress.equals(getNodeAddress())) { log.warn("We are sending a message to ourselves"); } @@ -305,7 +304,8 @@ public abstract class NetworkNode implements MessageListener { try { ListenableFuture future = executor.submit(() -> { String id = connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get().getFullAddress() : connection.getUid(); - Thread.currentThread().setName("NetworkNode:SendMessage-to-" + id); + Thread.currentThread().setName("NetworkNode:SendMessage-to-" + Utilities.toTruncatedString(id, 10)); + connection.sendMessage(networkEnvelope); return connection; });