From 332da7535d092a9b2022638b5a1121051fe2a76c Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 26 Apr 2023 10:09:04 -0400 Subject: [PATCH] repeatedly acquire trade lock to allow other threads to finish --- core/src/main/java/haveno/core/trade/Trade.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/haveno/core/trade/Trade.java b/core/src/main/java/haveno/core/trade/Trade.java index 1e52aee9..3c15d1c9 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -1145,13 +1145,11 @@ public abstract class Trade implements Tradable, Model { isShutDownStarted = true; if (wallet != null) log.info("{} {} preparing for shut down", getClass().getSimpleName(), getId()); - // allow other threads to finish processing by acquiring trade locks until there's no delay - int maxAttempts = 10; - for (int i = 0; i < maxAttempts; i++) { - long startTimeMs = System.currentTimeMillis(); + // repeatedly acquire trade lock to allow other threads to finish + for (int i = 0; i < 20; i++) { synchronized (this) { synchronized (walletLock) { - if (System.currentTimeMillis() - startTimeMs <= 10 || isShutDown) break; + if (isShutDown) break; } } } @@ -1626,6 +1624,7 @@ public abstract class Trade implements Tradable, Model { return BigInteger.valueOf(takerFee); } + @Override public BigInteger getTotalTxFee() { return BigInteger.valueOf(totalTxFee); }