[#1900] node: Fix loosing the "maintenance" status

In previous implementation node lost maintenance status after successful
switching to it. For example, after some period of time node sent
bootstrap requests with the "online" state instead of "maintenance".

Make `startMaintenance` method to set maintenance status in the
`networkState`.

Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
Leonard Lyubich 2022-10-28 11:08:49 +04:00 committed by fyrchik
parent db92e96e40
commit 98034005f1
3 changed files with 11 additions and 2 deletions

View file

@ -312,8 +312,9 @@ type internals struct {
}
// starts node's maintenance.
func (c *internals) startMaintenance() {
func (c *cfg) startMaintenance() {
c.isMaintenance.Store(true)
c.cfgNetmap.state.setControlNetmapStatus(control.NetmapStatus_MAINTENANCE)
c.log.Info("started local node's maintenance")
}