aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2017-02-01 09:03:43 +0800
committerGitHub <noreply@github.com>2017-02-01 09:03:43 +0800
commit9c45b4462c2453c0c92282290d9788aecf556798 (patch)
tree8746adcd24b48828a665b84ab87916e06df118ed /cmd
parent690f6ea1d74f949d4830d3a38c786510fc43d37c (diff)
parenta390ca5f30e871715f28937a02e87fff050b0c75 (diff)
downloadgo-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.tar
go-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.tar.gz
go-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.tar.bz2
go-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.tar.lz
go-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.tar.xz
go-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.tar.zst
go-tangerine-9c45b4462c2453c0c92282290d9788aecf556798.zip
Merge pull request #3607 from zsfelfoldi/light-fix2
les: fix private net issues, enable adding peers manually again
Diffstat (limited to 'cmd')
-rw-r--r--cmd/utils/flags.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 4b76b8334..9ba33df80 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -654,6 +654,10 @@ func MakeNode(ctx *cli.Context, name, gitCommit string) *node.Node {
vsn += "-" + gitCommit[:8]
}
+ // if we're running a light client or server, force enable the v5 peer discovery unless it is explicitly disabled with --nodiscover
+ // note that explicitly specifying --v5disc overrides --nodiscover, in which case the later only disables v4 discovery
+ forceV5Discovery := (ctx.GlobalBool(LightModeFlag.Name) || ctx.GlobalInt(LightServFlag.Name) > 0) && !ctx.GlobalBool(NoDiscoverFlag.Name)
+
config := &node.Config{
DataDir: MakeDataDir(ctx),
KeyStoreDir: ctx.GlobalString(KeyStoreDirFlag.Name),
@@ -662,8 +666,8 @@ func MakeNode(ctx *cli.Context, name, gitCommit string) *node.Node {
Name: name,
Version: vsn,
UserIdent: makeNodeUserIdent(ctx),
- NoDiscovery: ctx.GlobalBool(NoDiscoverFlag.Name) || ctx.GlobalBool(LightModeFlag.Name),
- DiscoveryV5: ctx.GlobalBool(DiscoveryV5Flag.Name) || ctx.GlobalBool(LightModeFlag.Name) || ctx.GlobalInt(LightServFlag.Name) > 0,
+ NoDiscovery: ctx.GlobalBool(NoDiscoverFlag.Name) || ctx.GlobalBool(LightModeFlag.Name), // always disable v4 discovery in light client mode
+ DiscoveryV5: ctx.GlobalBool(DiscoveryV5Flag.Name) || forceV5Discovery,
DiscoveryV5Addr: MakeDiscoveryV5Address(ctx),
BootstrapNodes: MakeBootstrapNodes(ctx),
BootstrapNodesV5: MakeBootstrapNodesV5(ctx),