forked from TrueCloudLab/neoneo-go
core: don't choose duplicating standby validators
We may already have chosen some of standby validators, so don't repeat.
This commit is contained in:
parent
f9c6a0d77c
commit
357b675090
1 changed files with 3 additions and 1 deletions
|
@ -1379,7 +1379,9 @@ func (bc *Blockchain) GetValidators(txes ...*transaction.Transaction) ([]*keys.P
|
|||
|
||||
result := pubKeys.Unique()
|
||||
for i := 0; i < uniqueSBValidators.Len() && result.Len() < count; i++ {
|
||||
result = append(result, uniqueSBValidators[i])
|
||||
if !result.Contains(uniqueSBValidators[i]) {
|
||||
result = append(result, uniqueSBValidators[i])
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue