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() { public List<Dispute> getDisputes() {
return arbitrationManager.getDisputesAsObservableList(); return new ArrayList<>(arbitrationManager.getDisputesAsObservableList());
} }
public Dispute getDispute(String tradeId) { public Dispute getDispute(String tradeId) {

View file

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