diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 96e8cd654c53..6786ac702d82 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1041,6 +1041,9 @@ func setRandomBootstrapNodes(ctx *cli.Context, bootnodes []string) []string { } // select random bootnodes selectcount := params.BootnodeCount + if selectcount > bootnodeslen { + selectcount = bootnodeslen + } urls := make([]string, selectcount) tempnode := make([]string, bootnodeslen) copy(tempnode, bootnodes)