diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index dcae1dd3a..648968f18 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -77,6 +77,8 @@ type cfg struct { key *keys.PrivateKey + binPublicKey []byte + ownerIDFromKey user.ID // user ID calculated from key apiVersion version.Version @@ -269,13 +271,14 @@ func initCfg(path string) *cfg { fatalOnErr(err) c := &cfg{ - ctx: context.Background(), - appCfg: appCfg, - internalErr: make(chan error), - log: log, - wg: new(sync.WaitGroup), - key: key, - apiVersion: version.Current(), + ctx: context.Background(), + appCfg: appCfg, + internalErr: make(chan error), + log: log, + wg: new(sync.WaitGroup), + key: key, + binPublicKey: key.PublicKey().Bytes(), + apiVersion: version.Current(), cfgAccounting: cfgAccounting{ scriptHash: contractsconfig.Balance(appCfg), }, diff --git a/cmd/neofs-node/netmap.go b/cmd/neofs-node/netmap.go index 8f5c58646..6174e29cf 100644 --- a/cmd/neofs-node/netmap.go +++ b/cmd/neofs-node/netmap.go @@ -288,7 +288,7 @@ func (c *cfg) netmapLocalNodeState(epoch uint64) (*netmapSDK.NodeInfo, error) { nmNodes := nm.Nodes() for i := range nmNodes { - if bytes.Equal(nmNodes[i].PublicKey(), c.key.PublicKey().Bytes()) { + if bytes.Equal(nmNodes[i].PublicKey(), c.binPublicKey) { return &nmNodes[i], nil } }