From e2f19c280eeb1a8f7294d943aaa2dc29707ce640 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 30 Apr 2024 12:52:24 -0400 Subject: [PATCH] defer dispute payout tx if awaiting peer ack --- .../core/support/dispute/DisputeManager.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/haveno/core/support/dispute/DisputeManager.java b/core/src/main/java/haveno/core/support/dispute/DisputeManager.java index 35c7a5408d..e1bbc87bda 100644 --- a/core/src/main/java/haveno/core/support/dispute/DisputeManager.java +++ b/core/src/main/java/haveno/core/support/dispute/DisputeManager.java @@ -739,12 +739,12 @@ public abstract class DisputeManager> extends Sup boolean exists = disputeResult.getChatMessage() != null && disputeResult.getChatMessage().getMessage() != null && !disputeResult.getChatMessage().getMessage().isEmpty(); if (!exists) { ChatMessage chatMessage = new ChatMessage( - getSupportType(), - dispute.getTradeId(), - dispute.getTraderPubKeyRing().hashCode(), - false, - summaryText, - p2PService.getAddress()); + getSupportType(), + dispute.getTradeId(), + dispute.getTraderPubKeyRing().hashCode(), + false, + summaryText, + p2PService.getAddress()); disputeResult.setChatMessage(chatMessage); dispute.addAndPersistChatMessage(chatMessage); } @@ -757,8 +757,7 @@ public abstract class DisputeManager> extends Sup // create dispute closed message TradePeer receiverPeer = receiver == trade.getBuyer() ? trade.getSeller() : trade.getBuyer(); - boolean deferPublishPayout = !exists && receiver.getUnsignedPayoutTxHex() != null && receiverPeer.getUpdatedMultisigHex() != null && trade.getDisputeState().ordinal() >= Trade.DisputeState.ARBITRATOR_SAW_ARRIVED_DISPUTE_CLOSED_MSG.ordinal(); - log.info("deferPublishPayout = {} = {} && {} && {} && {}", deferPublishPayout, !exists, receiver.getUnsignedPayoutTxHex() != null, receiverPeer.getUpdatedMultisigHex() != null, trade.getDisputeState().ordinal() >= Trade.DisputeState.ARBITRATOR_SAW_ARRIVED_DISPUTE_CLOSED_MSG.ordinal()); + boolean deferPublishPayout = !exists && receiver.getUnsignedPayoutTxHex() != null && receiverPeer.getUpdatedMultisigHex() != null && (trade.getDisputeState() == Trade.DisputeState.ARBITRATOR_SENT_DISPUTE_CLOSED_MSG || trade.getDisputeState() == Trade.DisputeState.ARBITRATOR_SAW_ARRIVED_DISPUTE_CLOSED_MSG); DisputeClosedMessage disputeClosedMessage = new DisputeClosedMessage(disputeResult, p2PService.getAddress(), UUID.randomUUID().toString(),