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:
Roman Khimov 2020-02-12 20:29:10 +03:00
parent f9c6a0d77c
commit 357b675090

View file

@ -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
}