forked from TrueCloudLab/frostfs-node
[#863] node: Prevent panic about missing Neo RPC endpoints
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8efea6e066
commit
50c4c5116d
1 changed files with 4 additions and 0 deletions
|
@ -37,6 +37,10 @@ func initMorphComponents(c *cfg) {
|
|||
var err error
|
||||
|
||||
fn := func(addresses []string, dialTimeout time.Duration, handler func(*client.Client)) {
|
||||
if len(addresses) == 0 {
|
||||
fatalOnErr(errors.New("missing Neo RPC endpoints"))
|
||||
}
|
||||
|
||||
crand := rand.New() // math/rand with cryptographic source
|
||||
crand.Shuffle(len(addresses), func(i, j int) {
|
||||
addresses[i], addresses[j] = addresses[j], addresses[i]
|
||||
|
|
Loading…
Reference in a new issue