Skip to content

Commit

Permalink
Fix concurrent modification exception in IPNS publish
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Dec 13, 2023
1 parent 4bba117 commit c1f2a46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/peergos/protocol/dht/Kademlia.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public CompletableFuture<Void> publishValue(PrivKey priv,
if (toQuery.size() == remaining) {
// publish to closest remaining nodes
while (publishes.size() < minPublishes) {
List<RoutingEntry> closest = toQuery.stream()
List<RoutingEntry> closest = new TreeSet<>(toQuery).stream()
.limit(minPublishes - publishes.size() + 5)
.collect(Collectors.toList());
List<? extends Future<?>> lastFutures = closest.stream()
Expand Down

0 comments on commit c1f2a46

Please sign in to comment.