mirror of
https://github.com/retoaccess1/haveno-reto.git
synced 2024-12-04 17:03:32 +01:00
trader can re-open dispute unless payout confirmed
This commit is contained in:
parent
5221782ba0
commit
59d8a8ee44
@ -359,6 +359,13 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skip if payout is confirmed
|
||||||
|
if (trade.isPayoutConfirmed()) {
|
||||||
|
String errorMsg = "Cannot open dispute because payout is already confirmed for " + trade.getClass().getSimpleName() + " " + trade.getId();
|
||||||
|
faultHandler.handleFault(errorMsg, new IllegalStateException(errorMsg));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (disputeList.getObservableList()) {
|
synchronized (disputeList.getObservableList()) {
|
||||||
if (disputeList.contains(dispute)) {
|
if (disputeList.contains(dispute)) {
|
||||||
String msg = "We got a dispute msg that we have already stored. TradeId = " + dispute.getTradeId() + ", DisputeId = " + dispute.getId();
|
String msg = "We got a dispute msg that we have already stored. TradeId = " + dispute.getTradeId() + ", DisputeId = " + dispute.getId();
|
||||||
@ -368,8 +375,7 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
|||||||
}
|
}
|
||||||
|
|
||||||
Optional<Dispute> storedDisputeOptional = findDispute(dispute);
|
Optional<Dispute> storedDisputeOptional = findDispute(dispute);
|
||||||
boolean reOpen = storedDisputeOptional.isPresent() && storedDisputeOptional.get().isClosed();
|
boolean reOpen = storedDisputeOptional.isPresent();
|
||||||
if (!storedDisputeOptional.isPresent() || reOpen) {
|
|
||||||
|
|
||||||
// add or re-open dispute
|
// add or re-open dispute
|
||||||
if (reOpen) {
|
if (reOpen) {
|
||||||
@ -472,12 +478,6 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
|||||||
errorMessage, new DisputeMessageDeliveryFailedException());
|
errorMessage, new DisputeMessageDeliveryFailedException());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
String msg = "We got a dispute already open for that trade and trading peer.\n" +
|
|
||||||
"TradeId = " + dispute.getTradeId();
|
|
||||||
log.warn(msg);
|
|
||||||
faultHandler.handleFault(msg, new DisputeAlreadyOpenException());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
requestPersistence();
|
requestPersistence();
|
||||||
|
Loading…
Reference in New Issue
Block a user