From 2a2eb0c82f181248627cab3e364ecb28bafcc4ac Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 25 Jan 2024 11:43:53 -0500 Subject: [PATCH] check if trade shut down started within lock --- .../main/java/haveno/core/trade/protocol/BuyerProtocol.java | 4 +--- .../main/java/haveno/core/trade/protocol/SellerProtocol.java | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/haveno/core/trade/protocol/BuyerProtocol.java b/core/src/main/java/haveno/core/trade/protocol/BuyerProtocol.java index 888e168b86..84d850c7be 100644 --- a/core/src/main/java/haveno/core/trade/protocol/BuyerProtocol.java +++ b/core/src/main/java/haveno/core/trade/protocol/BuyerProtocol.java @@ -54,11 +54,9 @@ public class BuyerProtocol extends DisputeProtocol { protected void onInitialized() { super.onInitialized(); - // done if shut down - if (trade.isShutDown()) return; - // re-send payment sent message if not acked synchronized (trade) { + if (trade.isShutDownStarted()) return; if (trade.getState().ordinal() >= Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal() && trade.getState().ordinal() < Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG.ordinal()) { latchTrade(); given(anyPhase(Trade.Phase.PAYMENT_SENT) diff --git a/core/src/main/java/haveno/core/trade/protocol/SellerProtocol.java b/core/src/main/java/haveno/core/trade/protocol/SellerProtocol.java index 01eda95e5e..7408fc2576 100644 --- a/core/src/main/java/haveno/core/trade/protocol/SellerProtocol.java +++ b/core/src/main/java/haveno/core/trade/protocol/SellerProtocol.java @@ -50,11 +50,9 @@ public class SellerProtocol extends DisputeProtocol { protected void onInitialized() { super.onInitialized(); - // done if shut down - if (trade.isShutDown()) return; - // re-send payment received message if payout not published synchronized (trade) { + if (trade.isShutDownStarted()) return; if (trade.getState().ordinal() >= Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal() && !trade.isPayoutPublished()) { latchTrade(); given(anyPhase(Trade.Phase.PAYMENT_RECEIVED)