diff --git a/p2p/src/main/java/haveno/network/p2p/network/NetworkNode.java b/p2p/src/main/java/haveno/network/p2p/network/NetworkNode.java index f24fdf6f928..422d6f049b9 100644 --- a/p2p/src/main/java/haveno/network/p2p/network/NetworkNode.java +++ b/p2p/src/main/java/haveno/network/p2p/network/NetworkNode.java @@ -239,7 +239,9 @@ public void onDisconnect(CloseConnectionReason closeConnectionReason, future.exceptionally(throwable -> { log.debug("onFailure at sendMessage: peersNodeAddress={}\n\tmessage={}\n\tthrowable={}", peersNodeAddress, networkEnvelope.getClass().getSimpleName(), throwable.toString()); UserThread.execute(() -> { - if (!resultFuture.setException(throwable)) { + if (isShutDownStarted) { + resultFuture.cancel(true); // ignore if shutting down + } else if (!resultFuture.setException(throwable)) { // In case the setException returns false we need to cancel the future. resultFuture.cancel(true); }