Skip to content

Commit

Permalink
cmd/devp2p: fix commandHasFlag (#29091)
Browse files Browse the repository at this point in the history
It got broken in some update of the cli library, and thus bootnodes weren't 
being configured automatically for some of the discovery commands.
  • Loading branch information
fjl authored Mar 4, 2024
1 parent 35cebc1 commit a97d622
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/devp2p/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ func commandHasFlag(ctx *cli.Context, flag cli.Flag) bool {
for _, name := range names {
set[name] = struct{}{}
}
for _, fn := range ctx.FlagNames() {
if _, ok := set[fn]; ok {
return true
for _, ctx := range ctx.Lineage() {
if ctx.Command != nil {
for _, f := range ctx.Command.Flags {
for _, name := range f.Names() {
if _, ok := set[name]; ok {
return true
}
}
}
}
}
return false
Expand Down

0 comments on commit a97d622

Please sign in to comment.