mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-05 13:49:18 -04:00
do not reset payment states if payout published
This commit is contained in:
parent
5107c6ba57
commit
2af9019db0
1 changed files with 13 additions and 9 deletions
|
@ -635,16 +635,20 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
|
||||||
ThreadUtils.execute(() -> onConnectionChanged(connection), getId());
|
ThreadUtils.execute(() -> onConnectionChanged(connection), getId());
|
||||||
});
|
});
|
||||||
|
|
||||||
// reset buyer's payment sent state if no ack receive
|
// reset states 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()) {
|
if (!isPayoutPublished()) {
|
||||||
log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
|
|
||||||
setState(Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset seller's payment received state if no ack receive
|
// reset buyer's payment sent state if no ack receive
|
||||||
if (this instanceof SellerTrade && getState().ordinal() >= Trade.State.SELLER_CONFIRMED_PAYMENT_RECEIPT.ordinal() && getState().ordinal() < Trade.State.SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG.ordinal()) {
|
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.BUYER_SENT_PAYMENT_SENT_MSG);
|
log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
|
||||||
resetToPaymentSentState();
|
setState(Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset seller's payment received state if no ack receive
|
||||||
|
if (this instanceof SellerTrade && getState().ordinal() >= Trade.State.SELLER_CONFIRMED_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.BUYER_SENT_PAYMENT_SENT_MSG);
|
||||||
|
resetToPaymentSentState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle trade state events
|
// handle trade state events
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue