Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Remove usage of deprecated ConcurrentSet #1512

Merged
merged 1 commit into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
package tech.pegasys.pantheon.ethereum.eth.sync.state;

import static java.util.Collections.newSetFromMap;

import tech.pegasys.pantheon.ethereum.core.Block;
import tech.pegasys.pantheon.ethereum.core.Hash;

Expand All @@ -23,8 +25,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import io.netty.util.internal.ConcurrentSet;

public class PendingBlocks {

private final Map<Hash, Block> pendingBlocks = new ConcurrentHashMap<>();
Expand All @@ -47,7 +47,7 @@ public boolean registerPendingBlock(final Block pendingBlock) {
.computeIfAbsent(
pendingBlock.getHeader().getParentHash(),
h -> {
final ConcurrentSet<Hash> set = new ConcurrentSet<>();
final Set<Hash> set = newSetFromMap(new ConcurrentHashMap<>());
// Go ahead and add our value at construction, so that we don't set an empty set which
// could be removed in deregisterPendingBlock
set.add(pendingBlock.getHash());
Expand Down