[#168] node: Refactor netmap service init

Resolve funlen linter for initNetmapService function

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-03-24 13:50:47 +03:00
parent dd572825c7
commit 1f929fdd57

View file

@ -135,7 +135,6 @@ func (c *cfg) addressNum() int {
return 0
}
// nolint: funlen
func initNetmapService(c *cfg) {
network.WriteToNodeInfo(c.localAddr, &c.cfgNodeInfo.localInfo)
c.cfgNodeInfo.localInfo.SetPublicKey(c.key.PublicKey().Bytes())
@ -173,6 +172,10 @@ func initNetmapService(c *cfg) {
netmapGRPC.RegisterNetmapServiceServer(srv, server)
}
addNewEpochNotificationHandlers(c)
}
func addNewEpochNotificationHandlers(c *cfg) {
addNewEpochNotificationHandler(c, func(ev event.Event) {
c.cfgNetmap.state.setCurrentEpoch(ev.(netmapEvent.NewEpoch).EpochNumber())
})