[#607] services/control: Fix incorrect allocation in NetmapSnapshot

Fix make with length + subsequent append.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-28 15:44:20 +03:00 committed by Leonard Lyubich
parent f8ee6b1164
commit 8eadf18e01

View file

@ -54,7 +54,7 @@ func nodesFromAPI(apiNodes netmapAPI.Nodes) []*control.NodeInfo {
node := new(control.NodeInfo)
node.SetPublicKey(apiNode.PublicKey())
addrs := make([]string, apiNode.NumberOfAddresses())
addrs := make([]string, 0, apiNode.NumberOfAddresses())
netmapAPI.IterateAllAddresses(apiNode.NodeInfo, func(s string) {
addrs = append(addrs, s)
})