diff --git a/apitest/src/test/java/haveno/apitest/method/trade/AbstractTradeTest.java b/apitest/src/test/java/haveno/apitest/method/trade/AbstractTradeTest.java index 21a4145cbe..0610b97621 100644 --- a/apitest/src/test/java/haveno/apitest/method/trade/AbstractTradeTest.java +++ b/apitest/src/test/java/haveno/apitest/method/trade/AbstractTradeTest.java @@ -18,8 +18,8 @@ import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL; import static haveno.core.trade.Trade.Phase.DEPOSITS_UNLOCKED; import static haveno.core.trade.Trade.Phase.PAYMENT_SENT; import static haveno.core.trade.Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG; +import static haveno.core.trade.Trade.State.BUYER_SENT_PAYMENT_SENT_MSG; import static haveno.core.trade.Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN; -import static haveno.core.trade.Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG; import static java.lang.String.format; import static java.lang.System.out; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -144,7 +144,7 @@ public class AbstractTradeTest extends AbstractOfferTest { GrpcClient grpcClient, String tradeId) { Predicate isTradeInPaymentReceiptConfirmedStateAndPhase = (t) -> - t.getState().equals(SELLER_RECEIVED_PAYMENT_SENT_MSG.name()) && + t.getState().equals(BUYER_SENT_PAYMENT_SENT_MSG.name()) && t.getPhase().equals(PAYMENT_SENT.name()); String userName = toUserName.apply(grpcClient); for (int i = 1; i <= maxTradeStateAndPhaseChecks.get(); i++) { 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 9daf00855f..fe275a7fa6 100644 --- a/core/src/main/java/haveno/core/support/dispute/DisputeManager.java +++ b/core/src/main/java/haveno/core/support/dispute/DisputeManager.java @@ -494,7 +494,7 @@ public abstract class DisputeManager> extends Sup if (trade.isArbitrator() && message.getPaymentSentMessage() != null) { HavenoUtils.verifyPaymentSentMessage(trade, message.getPaymentSentMessage()); trade.getBuyer().setUpdatedMultisigHex(message.getPaymentSentMessage().getUpdatedMultisigHex()); - trade.advanceState(sender == trade.getBuyer() ? Trade.State.BUYER_SENT_PAYMENT_SENT_MSG : Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG); + trade.advanceState(Trade.State.BUYER_SENT_PAYMENT_SENT_MSG); } // update multisig hex diff --git a/core/src/main/java/haveno/core/trade/Trade.java b/core/src/main/java/haveno/core/trade/Trade.java index 22f483cfab..252f61e60c 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -609,8 +609,8 @@ public abstract class Trade implements Tradable, Model { // reset seller's payment received state if no ack receive if (this instanceof SellerTrade && getState().ordinal() >= Trade.State.SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT.ordinal() && getState().ordinal() < Trade.State.SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG.ordinal()) { - log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG); - setState(Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG); + log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.BUYER_SENT_PAYMENT_SENT_MSG); + setState(Trade.State.BUYER_SENT_PAYMENT_SENT_MSG); } // handle trade phase events diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java index 0079d281da..854004aa02 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java @@ -70,7 +70,7 @@ public class ProcessPaymentSentMessage extends TradeTask { } // update state - trade.advanceState(trade.isSeller() ? Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG : Trade.State.BUYER_SENT_PAYMENT_SENT_MSG); + trade.advanceState(Trade.State.BUYER_SENT_PAYMENT_SENT_MSG); trade.requestPersistence(); complete(); } catch (Throwable t) { diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java index c2b6af466c..5fb8db9316 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java @@ -377,8 +377,8 @@ public class PendingTradesViewModel extends ActivatableWithDataModel