Skip to content

Commit

Permalink
ir: Fix announced address reading for the client creation
Browse files Browse the repository at this point in the history
Do not pass raw multi-address to client, use URI instead.
Refs nspcc-dev#2475.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
  • Loading branch information
carpawell committed Sep 8, 2023
1 parent 0a13794 commit 9012d5f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9012d5f

Please sign in to comment.