Compare commits
2 commits
master
...
reopen_dis
Author | SHA1 | Date | |
---|---|---|---|
|
111b7613c0 | ||
|
5f29e7e1a6 |
2 changed files with 108 additions and 108 deletions
|
@ -467,7 +467,7 @@ public final class Dispute implements NetworkPayload, PersistablePayload {
|
|||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
return this.disputeState == State.OPEN || this.disputeState == State.REOPENED;
|
||||
return isNew() || this.disputeState == State.OPEN || this.disputeState == State.REOPENED;
|
||||
}
|
||||
|
||||
public boolean isClosed() {
|
||||
|
|
|
@ -359,6 +359,13 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
|||
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()) {
|
||||
if (disputeList.contains(dispute)) {
|
||||
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);
|
||||
boolean reOpen = storedDisputeOptional.isPresent() && storedDisputeOptional.get().isClosed();
|
||||
if (!storedDisputeOptional.isPresent() || reOpen) {
|
||||
boolean reOpen = storedDisputeOptional.isPresent();
|
||||
|
||||
// add or re-open dispute
|
||||
if (reOpen) {
|
||||
|
@ -472,12 +478,6 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
|||
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();
|
||||
|
|
Loading…
Reference in a new issue