-
Notifications
You must be signed in to change notification settings - Fork 38
/
netmap.go
29 lines (23 loc) · 916 Bytes
/
netmap.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package innerring
import (
"fmt"
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap/nodevalidation/state"
netmapclient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
)
/*
File contains dependencies for processor of the Netmap contract's notifications.
*/
// wraps Netmap contract's client and provides state.NetworkSettings.
type networkSettings netmapclient.Client
// MaintenanceModeAllowed requests network configuration from the Sidechain
// and check allowance of storage node's maintenance mode according to it.
// Always returns state.ErrMaintenanceModeDisallowed.
func (s *networkSettings) MaintenanceModeAllowed() error {
allowed, err := (*netmapclient.Client)(s).MaintenanceModeAllowed()
if err != nil {
return fmt.Errorf("read maintenance mode's allowance from the Sidechain: %w", err)
} else if allowed {
return nil
}
return state.ErrMaintenanceModeDisallowed
}