[#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:
parent
10308101df
commit
7a64a70b12
3 changed files with 0 additions and 24 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue