File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import (
34
34
"github.com/dominant-strategies/go-quai/log"
35
35
"github.com/dominant-strategies/go-quai/metrics"
36
36
"github.com/dominant-strategies/go-quai/node"
37
+ "github.com/dominant-strategies/go-quai/p2p/nat"
37
38
"github.com/dominant-strategies/go-quai/params"
38
39
"github.com/naoina/toml"
39
40
)
@@ -103,8 +104,11 @@ func loadConfig(file string, cfg *quaiConfig) error {
103
104
return err
104
105
}
105
106
106
- func defaultNodeConfig () node.Config {
107
+ func defaultNodeConfig (ctx * cli. Context ) node.Config {
107
108
cfg := node .DefaultConfig
109
+ if ! ctx .GlobalBool (utils .LocalFlag .Name ) {
110
+ cfg .P2P .NAT = nat .Any ()
111
+ }
108
112
cfg .Name = clientIdentifier
109
113
cfg .Version = params .VersionWithCommit (gitCommit , gitDate )
110
114
cfg .HTTPModules = append (cfg .HTTPModules , "eth" )
@@ -118,7 +122,7 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, quaiConfig) {
118
122
// Load defaults.
119
123
cfg := quaiConfig {
120
124
Eth : ethconfig .Defaults ,
121
- Node : defaultNodeConfig (),
125
+ Node : defaultNodeConfig (ctx ),
122
126
Metrics : metrics .DefaultConfig ,
123
127
}
124
128
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import (
23
23
"runtime"
24
24
25
25
"github.com/dominant-strategies/go-quai/p2p"
26
- "github.com/dominant-strategies/go-quai/p2p/nat"
27
26
"github.com/dominant-strategies/go-quai/rpc"
28
27
)
29
28
@@ -46,7 +45,6 @@ var DefaultConfig = Config{
46
45
P2P : p2p.Config {
47
46
ListenAddr : ":30303" ,
48
47
MaxPeers : 50 ,
49
- NAT : nat .Any (),
50
48
},
51
49
DBEngine : "" ,
52
50
}
You can’t perform that action at this time.
0 commit comments