Skip to content

Commit 29cdec0

Browse files
authored
fix: default port6 to ipv4 port if set explicitly (#8504)
Default `port6` to the `--port` (ipv4 port) if set explicitly and `--port6` is not set.
1 parent f2a741b commit 29cdec0

File tree

1 file changed

+3
-3
lines changed
  • packages/cli/src/options/beaconNodeOptions

1 file changed

+3
-3
lines changed

packages/cli/src/options/beaconNodeOptions/network.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ export function parseListenArgs(args: NetworkArgs) {
6363
// If listenAddress6 is not set, use defaultListenAddress
6464
const listenAddress = args.listenAddress ?? (args.listenAddress6 ? undefined : defaultListenAddress);
6565
const port = listenAddress ? (args.port ?? defaultP2pPort) : undefined;
66-
const discoveryPort = listenAddress ? (args.discoveryPort ?? args.port ?? defaultP2pPort) : undefined;
66+
const discoveryPort = listenAddress ? (args.discoveryPort ?? port) : undefined;
6767

6868
// If listenAddress6 is explicitly set, use it
6969
// If listenAddress is not set, use defaultListenAddress6
7070
const listenAddress6 = args.listenAddress6 ?? (args.listenAddress ? undefined : defaultListenAddress6);
71-
const port6 = listenAddress6 ? (args.port6 ?? defaultP2pPort) : undefined;
72-
const discoveryPort6 = listenAddress6 ? (args.discoveryPort6 ?? args.port6 ?? defaultP2pPort) : undefined;
71+
const port6 = listenAddress6 ? (args.port6 ?? args.port ?? defaultP2pPort) : undefined;
72+
const discoveryPort6 = listenAddress6 ? (args.discoveryPort6 ?? port6) : undefined;
7373

7474
return {listenAddress, port, discoveryPort, listenAddress6, port6, discoveryPort6};
7575
}

0 commit comments

Comments
 (0)