[#2156] core/netmap: Change node addresses iteration order

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2022-12-14 13:15:17 +03:00 committed by Anton Nikiforov
parent a68ff67ed8
commit 0244f2e5ce
2 changed files with 2 additions and 1 deletions

View file

@ -56,6 +56,7 @@ Changelog for NeoFS Node
- Panic in `GETRANGE` with zero length (#2095) - Panic in `GETRANGE` with zero length (#2095)
- Spawning useless `GETRANGE` with zero length for a big object (#2101) - Spawning useless `GETRANGE` with zero length for a big object (#2101)
- Incomplete object put errors do contain the deepest error's message (#2092) - Incomplete object put errors do contain the deepest error's message (#2092)
- Prioritize internal addresses for clients (#2156)
### Removed ### Removed
- `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089) - `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089)

View file

@ -17,12 +17,12 @@ func (x Node) PublicKey() []byte {
// IterateAddresses iterates over all announced network addresses // IterateAddresses iterates over all announced network addresses
// and passes them into f. Handler MUST NOT be nil. // and passes them into f. Handler MUST NOT be nil.
func (x Node) IterateAddresses(f func(string) bool) { func (x Node) IterateAddresses(f func(string) bool) {
(netmap.NodeInfo)(x).IterateNetworkEndpoints(f)
for _, addr := range (netmap.NodeInfo)(x).ExternalAddresses() { for _, addr := range (netmap.NodeInfo)(x).ExternalAddresses() {
if f(addr) { if f(addr) {
return return
} }
} }
(netmap.NodeInfo)(x).IterateNetworkEndpoints(f)
} }
// NumberOfAddresses returns number of announced network addresses. // NumberOfAddresses returns number of announced network addresses.