do not reset payment states if payout published

This commit is contained in:
woodser 2025-03-17 09:24:16 -04:00 committed by woodser
parent 5107c6ba57
commit 2af9019db0

View file

@ -635,6 +635,9 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
ThreadUtils.execute(() -> onConnectionChanged(connection), getId());
});
// reset states if no ack receive
if (!isPayoutPublished()) {
// reset buyer's payment sent state if no ack receive
if (this instanceof BuyerTrade && getState().ordinal() >= Trade.State.BUYER_CONFIRMED_PAYMENT_SENT.ordinal() && getState().ordinal() < Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG.ordinal()) {
log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
@ -646,6 +649,7 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.BUYER_SENT_PAYMENT_SENT_MSG);
resetToPaymentSentState();
}
}
// handle trade state events
tradeStateSubscription = EasyBind.subscribe(stateProperty, newValue -> {