From 86a853bfb996c2377a346e161b522d4a26edb195 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Sun, 8 Nov 2020 16:00:39 -0500 Subject: [PATCH] Set response time only in non error case --- .../src/main/java/bisq/inventory/InventoryMonitor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inventory/src/main/java/bisq/inventory/InventoryMonitor.java b/inventory/src/main/java/bisq/inventory/InventoryMonitor.java index 1b866c67e8..c807b351cf 100644 --- a/inventory/src/main/java/bisq/inventory/InventoryMonitor.java +++ b/inventory/src/main/java/bisq/inventory/InventoryMonitor.java @@ -154,16 +154,17 @@ public class InventoryMonitor implements SetupListener { RequestInfo requestInfo, @Nullable Map result, @Nullable String errorMessage) { - if (errorMessage != null) { + long responseTime = System.currentTimeMillis(); + if (errorMessage != null && !errorMessage.isEmpty()) { log.warn("Error at connection to peer {}: {}", nodeAddress, errorMessage); requestInfo.setErrorMessage(errorMessage); + } else { + requestInfo.setResponseTime(responseTime); } boolean ignoreDeviationAtStartup; if (result != null) { log.info("nodeAddress={}, result={}", nodeAddress, result.toString()); - long responseTime = System.currentTimeMillis(); - requestInfo.setResponseTime(responseTime); // If seed just started up we ignore the deviation as it can be expected that seed is still syncing // DAO state/blocks. P2P data should be ready but as we received it from other seeds it is not that