From 9012d5f50058b1e48bd7b1c88f281ded2d3ef052 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 8 Sep 2023 16:00:08 +0300 Subject: [PATCH] ir: Fix announced address reading for the client creation Do not pass raw multi-address to client, use URI instead. Refs #2475. Signed-off-by: Pavel Karpy --- .../netmap/nodevalidation/availability/validator.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/innerring/processors/netmap/nodevalidation/availability/validator.go b/pkg/innerring/processors/netmap/nodevalidation/availability/validator.go index e75e0ca391..209dac7b5b 100644 --- a/pkg/innerring/processors/netmap/nodevalidation/availability/validator.go +++ b/pkg/innerring/processors/netmap/nodevalidation/availability/validator.go @@ -6,6 +6,7 @@ import ( "fmt" "time" + "github.com/nspcc-dev/neofs-node/pkg/network" "github.com/nspcc-dev/neofs-sdk-go/client" "github.com/nspcc-dev/neofs-sdk-go/netmap" ) @@ -130,12 +131,18 @@ func compareNodeInfos(niExp, niGot netmap.NodeInfo) error { const pingTimeout = 15 * time.Second func createSDKClient(e string) (*client.Client, error) { + var a network.Address + err := a.FromString(e) + if err != nil { + return nil, fmt.Errorf("parsing address: %w", err) + } + var prmInit client.PrmInit var prmDial client.PrmDial prmDial.SetTimeout(pingTimeout) prmDial.SetStreamTimeout(pingTimeout) - prmDial.SetServerURI(e) + prmDial.SetServerURI(a.URIAddr()) c, err := client.New(prmInit) if err != nil {