From 35be468de0e6e142d62782bcdbe5b553b6fa6bd0 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 15 Nov 2023 08:24:00 -0500 Subject: [PATCH] fixes to warning when wallet is too far behind daemon --- core/src/main/java/haveno/core/trade/Trade.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/haveno/core/trade/Trade.java b/core/src/main/java/haveno/core/trade/Trade.java index b459357e22..dfb27511e2 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -20,7 +20,7 @@ package haveno.core.trade; import com.google.common.base.Preconditions; import com.google.protobuf.ByteString; import com.google.protobuf.Message; - +import common.utils.GenUtils; import haveno.common.UserThread; import haveno.common.config.Config; import haveno.common.crypto.Encryption; @@ -1833,8 +1833,9 @@ public abstract class Trade implements Tradable, Model { // log warning if wallet is too far behind daemon MoneroDaemonInfo lastInfo = xmrWalletService.getConnectionsService().getLastInfo(); - if (!Config.baseCurrencyNetwork().isTestnet() && isDepositsPublished() && lastInfo != null && wallet.getHeight() < lastInfo.getHeight() - 3) { - log.warn("Wallet is more than 3 blocks behind monerod for {} {}, wallet height={}, monerod height={},", getClass().getSimpleName(), getShortId(), lastInfo.getHeight(), wallet.getHeight()); + long walletHeight = wallet.getHeight(); + if (wasWalletSynced && isDepositsPublished() && lastInfo != null && walletHeight < lastInfo.getHeight() - 3 && !Config.baseCurrencyNetwork().isTestnet()) { + log.warn("Wallet is more than 3 blocks behind monerod for {} {}, wallet height={}, monerod height={},", getClass().getSimpleName(), getShortId(), walletHeight, lastInfo.getHeight()); } // skip if either deposit tx id is unknown