From ab94b2d6fa1b76c9fc5ca5cff194f9266995b207 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 2 Mar 2023 17:01:09 -0500 Subject: [PATCH] fix concurrent modification exception fetching disputes --- core/src/main/java/bisq/core/api/CoreDisputesService.java | 2 +- .../main/java/bisq/core/support/dispute/DisputeManager.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/api/CoreDisputesService.java b/core/src/main/java/bisq/core/api/CoreDisputesService.java index 3c23d09273..347ace2203 100644 --- a/core/src/main/java/bisq/core/api/CoreDisputesService.java +++ b/core/src/main/java/bisq/core/api/CoreDisputesService.java @@ -71,7 +71,7 @@ public class CoreDisputesService { } public List getDisputes() { - return arbitrationManager.getDisputesAsObservableList(); + return new ArrayList<>(arbitrationManager.getDisputesAsObservableList()); } public Dispute getDispute(String tradeId) { diff --git a/core/src/main/java/bisq/core/support/dispute/DisputeManager.java b/core/src/main/java/bisq/core/support/dispute/DisputeManager.java index 7517b5aeeb..2634043a37 100644 --- a/core/src/main/java/bisq/core/support/dispute/DisputeManager.java +++ b/core/src/main/java/bisq/core/support/dispute/DisputeManager.java @@ -222,7 +222,9 @@ public abstract class DisputeManager> extends Sup } public ObservableList getDisputesAsObservableList() { - return disputeListService.getObservableList(); + synchronized(disputeListService.getDisputeList()) { + return disputeListService.getObservableList(); + } } public String getNrOfDisputes(boolean isBuyer, Contract contract) {