From 0244f2e5ceb11d443faba2cbed0d3b6f40727bcc Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 14 Dec 2022 13:15:17 +0300 Subject: [PATCH] [#2156] core/netmap: Change node addresses iteration order Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + pkg/core/netmap/nodes.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4df9286f..6ea480413 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Changelog for NeoFS Node - Panic in `GETRANGE` with zero length (#2095) - Spawning useless `GETRANGE` with zero length for a big object (#2101) - Incomplete object put errors do contain the deepest error's message (#2092) +- Prioritize internal addresses for clients (#2156) ### Removed - `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089) diff --git a/pkg/core/netmap/nodes.go b/pkg/core/netmap/nodes.go index 9fedbb31f..1fd9fdf24 100644 --- a/pkg/core/netmap/nodes.go +++ b/pkg/core/netmap/nodes.go @@ -17,12 +17,12 @@ func (x Node) PublicKey() []byte { // IterateAddresses iterates over all announced network addresses // and passes them into f. Handler MUST NOT be nil. func (x Node) IterateAddresses(f func(string) bool) { + (netmap.NodeInfo)(x).IterateNetworkEndpoints(f) for _, addr := range (netmap.NodeInfo)(x).ExternalAddresses() { if f(addr) { return } } - (netmap.NodeInfo)(x).IterateNetworkEndpoints(f) } // NumberOfAddresses returns number of announced network addresses.