cmd/devp2p: fix commandHasFlag (#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.
This commit is contained in:
parent
35cebc1687
commit
a97d622588
@ -66,9 +66,15 @@ func commandHasFlag(ctx *cli.Context, flag cli.Flag) bool {
|
|||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
set[name] = struct{}{}
|
set[name] = struct{}{}
|
||||||
}
|
}
|
||||||
for _, fn := range ctx.FlagNames() {
|
for _, ctx := range ctx.Lineage() {
|
||||||
if _, ok := set[fn]; ok {
|
if ctx.Command != nil {
|
||||||
return true
|
for _, f := range ctx.Command.Flags {
|
||||||
|
for _, name := range f.Names() {
|
||||||
|
if _, ok := set[name]; ok {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user