Skip to content

Commit c649d68

Browse files
fjljorgemmsilva
authored andcommitted
cmd/devp2p: fix commandHasFlag (ethereum#29091)
It got broken in some update of the cli library, and thus bootnodes weren't being configured automatically for some of the discovery commands.
1 parent d327e1a commit c649d68

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cmd/devp2p/main.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ func commandHasFlag(ctx *cli.Context, flag cli.Flag) bool {
6666
for _, name := range names {
6767
set[name] = struct{}{}
6868
}
69-
for _, fn := range ctx.FlagNames() {
70-
if _, ok := set[fn]; ok {
71-
return true
69+
for _, ctx := range ctx.Lineage() {
70+
if ctx.Command != nil {
71+
for _, f := range ctx.Command.Flags {
72+
for _, name := range f.Names() {
73+
if _, ok := set[name]; ok {
74+
return true
75+
}
76+
}
77+
}
7278
}
7379
}
7480
return false

0 commit comments

Comments
 (0)