[#331] pool: Fix 'sortServers' in tree pool server test
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
parent
4ecbfb0edf
commit
5a35fa4353
1 changed files with 4 additions and 1 deletions
|
@ -183,12 +183,15 @@ func sortServers(ctx context.Context, servers []*mockTreeServer, source *mockNet
|
|||
}
|
||||
|
||||
// find servers based on public key and store pointers in res
|
||||
index := 0
|
||||
for i := range priorityNodes {
|
||||
for j := range priorityNodes[i] {
|
||||
key := priorityNodes[i][j].PublicKey()
|
||||
for k := range servers {
|
||||
if bytes.Equal(servers[k].key.PublicKey().Bytes(), key) {
|
||||
res[i+j] = servers[k]
|
||||
res[index] = servers[k]
|
||||
index++
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue