From c8e2ca2ab4777f0bf830045368ae12c0fd99c6e4 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 27 Apr 2024 14:20:06 +0300 Subject: [PATCH] [#1110] node: Rename handleLocalNodeInfo() It is used in "handler" only once, what we really do is set the variable. And we have another "local" node info in `cfgNodeInfo`, this one is not really local (node info), more like (local node) info, so use setContractNodeInfo to distinguish it from the local view on the node info. Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-node/config.go | 4 ++-- cmd/frostfs-node/netmap.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index eb9f9fb18..cf4a1e4c3 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -1157,10 +1157,10 @@ func (c *cfg) LocalNodeInfo() (*netmapV2.NodeInfo, error) { return &res, nil } -// handleLocalNodeInfo rewrites local node info from the FrostFS network map. +// setContractNodeInfo rewrites local node info from the FrostFS network map. // Called with nil when storage node is outside the FrostFS network map // (before entering the network and after leaving it). -func (c *cfg) handleLocalNodeInfo(ni *netmap.NodeInfo) { +func (c *cfg) setContractNodeInfo(ni *netmap.NodeInfo) { c.cfgNetmap.state.setNodeInfo(ni) } diff --git a/cmd/frostfs-node/netmap.go b/cmd/frostfs-node/netmap.go index f3cdfe711..683c186fa 100644 --- a/cmd/frostfs-node/netmap.go +++ b/cmd/frostfs-node/netmap.go @@ -199,7 +199,7 @@ func addNewEpochNotificationHandlers(c *cfg) { return } - c.handleLocalNodeInfo(ni) + c.setContractNodeInfo(ni) }) if c.cfgMorph.notaryEnabled { @@ -270,7 +270,7 @@ func initNetmapState(c *cfg) { c.cfgNetmap.state.setCurrentEpoch(epoch) c.cfgNetmap.startEpoch = epoch - c.handleLocalNodeInfo(ni) + c.setContractNodeInfo(ni) } func nodeState(ni *netmapSDK.NodeInfo) string {