diff --git a/pkg/services/container/announcement/load/route/calls.go b/pkg/services/container/announcement/load/route/calls.go index f0e4147f15..7ad6a83b37 100644 --- a/pkg/services/container/announcement/load/route/calls.go +++ b/pkg/services/container/announcement/load/route/calls.go @@ -2,6 +2,7 @@ package loadroute import ( "context" + "encoding/hex" "sync" "github.com/nspcc-dev/neofs-api-go/pkg/container" @@ -110,13 +111,13 @@ func (w *loadWriter) Put(a container.UsedSpaceAnnouncement) error { } for _, remoteInfo := range routeValues.route { - var endpoint string + var key string if remoteInfo != nil { - endpoint = remoteInfo.Address() + key = hex.EncodeToString(remoteInfo.PublicKey()) } - remoteWriter, ok := w.mServers[endpoint] + remoteWriter, ok := w.mServers[key] if !ok { provider, err := w.router.remoteProvider.InitRemote(remoteInfo) if err != nil { @@ -136,7 +137,7 @@ func (w *loadWriter) Put(a container.UsedSpaceAnnouncement) error { continue // best effort } - w.mServers[endpoint] = remoteWriter + w.mServers[key] = remoteWriter } err := remoteWriter.Put(a) @@ -153,11 +154,11 @@ func (w *loadWriter) Put(a container.UsedSpaceAnnouncement) error { } func (w *loadWriter) Close() error { - for endpoint, wRemote := range w.mServers { + for key, wRemote := range w.mServers { err := wRemote.Close() if err != nil { w.router.log.Debug("could not close remote server writer", - zap.String("endpoint", endpoint), + zap.String("key", key), zap.String("error", err.Error()), ) }