From 3aa5fef8ab78867d352ea7fbb6941f4ecfe56233 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 30 Jul 2023 07:27:35 -0400 Subject: [PATCH] fix concurrent modification exception in ArbitrationDisputeList --- .../dispute/arbitration/ArbitrationDisputeList.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationDisputeList.java b/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationDisputeList.java index e040a34f9d..d40943efe3 100644 --- a/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationDisputeList.java +++ b/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationDisputeList.java @@ -57,11 +57,11 @@ public final class ArbitrationDisputeList extends DisputeList { @Override public Message toProtoMessage() { - - forEach(dispute -> checkArgument(dispute.getSupportType().equals(SupportType.ARBITRATION), "Support type has to be ARBITRATION")); - - return protobuf.PersistableEnvelope.newBuilder().setArbitrationDisputeList(protobuf.ArbitrationDisputeList.newBuilder() - .addAllDispute(ProtoUtil.collectionToProto(getList(), protobuf.Dispute.class))).build(); + synchronized (this.list) { + forEach(dispute -> checkArgument(dispute.getSupportType().equals(SupportType.ARBITRATION), "Support type has to be ARBITRATION")); + return protobuf.PersistableEnvelope.newBuilder().setArbitrationDisputeList(protobuf.ArbitrationDisputeList.newBuilder() + .addAllDispute(ProtoUtil.collectionToProto(getList(), protobuf.Dispute.class))).build(); + } } public static ArbitrationDisputeList fromProto(protobuf.ArbitrationDisputeList proto,