Commit 4df80ce8 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #7098 from ethereum-optimism/aj/fix-netrestrict

op-node: Default to no netrestrict instead of allow none
parents 2f745cb5 c33e8084
...@@ -156,7 +156,6 @@ var ( ...@@ -156,7 +156,6 @@ var (
Name: "p2p.netrestrict", Name: "p2p.netrestrict",
Usage: "Comma-separated list of CIDR masks. P2P will only try to connect on these networks", Usage: "Comma-separated list of CIDR masks. P2P will only try to connect on these networks",
Required: false, Required: false,
Value: "",
EnvVars: p2pEnv("NETRESTRICT"), EnvVars: p2pEnv("NETRESTRICT"),
} }
HostMux = &cli.StringFlag{ HostMux = &cli.StringFlag{
......
...@@ -194,13 +194,14 @@ func loadDiscoveryOpts(conf *p2p.Config, ctx *cli.Context) error { ...@@ -194,13 +194,14 @@ func loadDiscoveryOpts(conf *p2p.Config, ctx *cli.Context) error {
conf.Bootnodes = p2p.DefaultBootnodes conf.Bootnodes = p2p.DefaultBootnodes
} }
netRestrict, err := netutil.ParseNetlist(ctx.String(flags.NetRestrict.Name)) if ctx.IsSet(flags.NetRestrict.Name) {
if err != nil { netRestrict, err := netutil.ParseNetlist(ctx.String(flags.NetRestrict.Name))
return fmt.Errorf("failed to parse net list: %w", err) if err != nil {
return fmt.Errorf("failed to parse net list: %w", err)
}
conf.NetRestrict = netRestrict
} }
conf.NetRestrict = netRestrict
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment