[#492] node: Never go offline on application shutdown

Application can be shut down often, it is undesirable to send status changes
on a transaction every time. Control API should be used before shutdown for
this purpose.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-12 12:00:59 +03:00 committed by Leonard Lyubich
parent 10308101df
commit 7a64a70b12
3 changed files with 0 additions and 24 deletions

View file

@ -189,21 +189,6 @@ func addNewEpochAsyncNotificationHandler(c *cfg, h event.Handler) {
)
}
func goOffline(c *cfg) {
err := c.cfgNetmap.wrapper.UpdatePeerState(
crypto.MarshalPublicKey(&c.key.PublicKey),
netmapSDK.NodeStateOffline,
)
if err != nil {
c.log.Error("could not go offline",
zap.String("error", err.Error()),
)
} else {
c.log.Info("request to go offline successfully sent")
}
}
func (c *cfg) SetNetmapStatus(st control.NetmapStatus) error {
if st == control.NetmapStatus_ONLINE {
c.cfgNetmap.reBoostrapTurnedOff.Store(false)