From a6f6f5c00a376493fcc7fc9fea2991dcca1ede45 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 7 Jan 2024 22:37:41 -0500 Subject: [PATCH] protocols skip resending payment sent/received if shut down --- .../main/java/haveno/core/trade/protocol/BuyerProtocol.java | 3 +++ .../main/java/haveno/core/trade/protocol/SellerProtocol.java | 3 +++ 2 files changed, 6 insertions(+) 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 ebb44b24aa..6aca54c415 100644 --- a/core/src/main/java/haveno/core/trade/protocol/BuyerProtocol.java +++ b/core/src/main/java/haveno/core/trade/protocol/BuyerProtocol.java @@ -54,6 +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.getState().ordinal() >= Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal() && trade.getState().ordinal() < Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG.ordinal()) { 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 add371600d..11a4d91def 100644 --- a/core/src/main/java/haveno/core/trade/protocol/SellerProtocol.java +++ b/core/src/main/java/haveno/core/trade/protocol/SellerProtocol.java @@ -50,6 +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.getState().ordinal() >= Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal() && !trade.isPayoutPublished()) {