From c1f2a4634d34dada397a374f736499787da57c57 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 13 Dec 2023 15:41:21 +0000 Subject: [PATCH] Fix concurrent modification exception in IPNS publish --- src/main/java/org/peergos/protocol/dht/Kademlia.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/peergos/protocol/dht/Kademlia.java b/src/main/java/org/peergos/protocol/dht/Kademlia.java index 85b850a3..3e821d65 100644 --- a/src/main/java/org/peergos/protocol/dht/Kademlia.java +++ b/src/main/java/org/peergos/protocol/dht/Kademlia.java @@ -388,7 +388,7 @@ public CompletableFuture publishValue(PrivKey priv, if (toQuery.size() == remaining) { // publish to closest remaining nodes while (publishes.size() < minPublishes) { - List closest = toQuery.stream() + List closest = new TreeSet<>(toQuery).stream() .limit(minPublishes - publishes.size() + 5) .collect(Collectors.toList()); List> lastFutures = closest.stream()