Skip to content

Commit

Permalink
fix: prevent non-local IP enr warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Jul 25, 2023
1 parent ab285d3 commit 8010d36
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/cli/src/cmds/beacon/initPeerIdAndEnr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ export function isLocalMultiAddr(multiaddr: Multiaddr | undefined): boolean {
}

export function overwriteEnrWithCliArgs(enr: SignableENR, args: BeaconArgs, logger: Logger): void {
const {listenAddress, port, discoveryPort, listenAddress6, port6, discoveryPort6} = parseListenArgs(args);
enr.ip = args["enr.ip"] ?? listenAddress;
enr.tcp = args["enr.tcp"] ?? port;
enr.udp = args["enr.udp"] ?? discoveryPort;
enr.ip6 = args["enr.ip6"] ?? listenAddress6;
enr.tcp6 = args["enr.tcp6"] ?? port6;
enr.udp6 = args["enr.udp6"] ?? discoveryPort6;
const {port, discoveryPort, port6, discoveryPort6} = parseListenArgs(args);
enr.ip = args["enr.ip"] ?? enr.ip;
enr.tcp = args["enr.tcp"] ?? port ?? enr.tcp;
enr.udp = args["enr.udp"] ?? discoveryPort ?? enr.udp;
enr.ip6 = args["enr.ip6"] ?? enr.ip6;
enr.tcp6 = args["enr.tcp6"] ?? port6 ?? enr.tcp6;
enr.udp6 = args["enr.udp6"] ?? discoveryPort6 ?? enr.udp6;

function testMultiaddrForLocal(mu: Multiaddr, ip4: boolean): void {
const isLocal = isLocalMultiAddr(mu);
Expand Down

0 comments on commit 8010d36

Please sign in to comment.