fix concurrent modification exception fetching disputes

This commit is contained in:
woodser 2023-03-02 17:01:09 -05:00
parent 17d94f346c
commit ab94b2d6fa
2 changed files with 4 additions and 2 deletions

View file

@ -71,7 +71,7 @@ public class CoreDisputesService {
}
public List<Dispute> getDisputes() {
return arbitrationManager.getDisputesAsObservableList();
return new ArrayList<>(arbitrationManager.getDisputesAsObservableList());
}
public Dispute getDispute(String tradeId) {

View file

@ -222,8 +222,10 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
}
public ObservableList<Dispute> getDisputesAsObservableList() {
synchronized(disputeListService.getDisputeList()) {
return disputeListService.getObservableList();
}
}
public String getNrOfDisputes(boolean isBuyer, Contract contract) {
return disputeListService.getNrOfDisputes(isBuyer, contract);