Skip to content

Commit

Permalink
Use a set
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Jul 1, 2024
1 parent d1c1ec0 commit 4959c8b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

package tech.pegasys.teku.networking.nat;

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.service.serviceutils.Service;

Expand Down Expand Up @@ -59,8 +61,10 @@ protected SafeFuture<Void> doStart() {
.start()
.thenRun(
() -> {
requestPortForward(natManager, p2pPort);
p2pPortIpv6.ifPresent(port -> requestPortForward(natManager, port));
final Set<Integer> p2pPorts = new HashSet<>();
p2pPorts.add(p2pPort);
p2pPortIpv6.ifPresent(p2pPorts::add);
p2pPorts.forEach(port -> requestPortForward(natManager, port));
});
}

Expand Down

0 comments on commit 4959c8b

Please sign in to comment.