diff --git a/pkg/services/netmap/executor.go b/pkg/services/netmap/executor.go index c8ff143629..12b3ffd4e1 100644 --- a/pkg/services/netmap/executor.go +++ b/pkg/services/netmap/executor.go @@ -45,12 +45,30 @@ func NewExecutionService(s NodeState, v *pkg.Version, netInfo NetworkInfo) Serve func (s *executorSvc) LocalNodeInfo( _ context.Context, - _ *netmap.LocalNodeInfoRequest) (*netmap.LocalNodeInfoResponse, error) { + req *netmap.LocalNodeInfoRequest) (*netmap.LocalNodeInfoResponse, error) { + ver := pkg.NewVersionFromV2(req.GetMetaHeader().GetVersion()) + if err := pkg.IsSupportedVersion(ver); err != nil { + return nil, err + } + ni, err := s.state.LocalNodeInfo() if err != nil { return nil, err } + if addrNum := ni.NumberOfAddresses(); addrNum > 0 && ver.Minor() <= 7 { + ni2 := new(netmap.NodeInfo) + ni2.SetPublicKey(ni.GetPublicKey()) + ni2.SetState(ni.GetState()) + ni2.SetAttributes(ni.GetAttributes()) + ni.IterateAddresses(func(s string) bool { + ni2.SetAddresses(s) + return true + }) + + ni = ni2 + } + body := new(netmap.LocalNodeInfoResponseBody) body.SetVersion(s.version.ToV2()) body.SetNodeInfo(ni)