mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-12-16 16:24:29 -05:00
revert payout state across all peers consistently
This commit is contained in:
parent
ba2bf262ce
commit
a0bb784d3e
1 changed files with 2 additions and 6 deletions
|
|
@ -3492,14 +3492,10 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
|
||||||
// revert state
|
// revert state
|
||||||
setPayoutState(PayoutState.PAYOUT_UNPUBLISHED);
|
setPayoutState(PayoutState.PAYOUT_UNPUBLISHED);
|
||||||
String errorMsg = "The payout transaction is not seen for trade " + getShortId() + ". This can happen after a blockchain reorganization..\n\nIf the payout does not confirm automatically, you can contact support or mark the trade as failed.";
|
String errorMsg = "The payout transaction is not seen for trade " + getShortId() + ". This can happen after a blockchain reorganization..\n\nIf the payout does not confirm automatically, you can contact support or mark the trade as failed.";
|
||||||
if (isSeller() && getState().ordinal() >= State.BUYER_RECEIVED_PAYMENT_RECEIVED_MSG.ordinal()) {
|
if (getState().ordinal() >= State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal()) {
|
||||||
log.warn("Reverting state of {} {} from {} to {} because payout is unseen. Possible reorg?", getClass().getSimpleName(), getId(), getState(), Trade.State.BUYER_SENT_PAYMENT_SENT_MSG);
|
|
||||||
setState(State.SELLER_SENT_PAYMENT_RECEIVED_MSG);
|
|
||||||
onPayoutError(false, true, null);
|
|
||||||
setErrorMessage(errorMsg);
|
|
||||||
} else if (getState().ordinal() >= State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal()) {
|
|
||||||
log.warn("Reverting state of {} {} from {} to {} because payout is unseen. Possible reorg?", getClass().getSimpleName(), getId(), getState(), Trade.State.SELLER_CONFIRMED_PAYMENT_RECEIPT);
|
log.warn("Reverting state of {} {} from {} to {} because payout is unseen. Possible reorg?", getClass().getSimpleName(), getId(), getState(), Trade.State.SELLER_CONFIRMED_PAYMENT_RECEIPT);
|
||||||
setState(State.SELLER_CONFIRMED_PAYMENT_RECEIPT);
|
setState(State.SELLER_CONFIRMED_PAYMENT_RECEIPT);
|
||||||
|
if (isSeller()) onPayoutError(false, true, null);
|
||||||
setErrorMessage(errorMsg);
|
setErrorMessage(errorMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue