frostfs-node/pkg/innerring/processors/neofs/process_update.go
Alex Vanin 4aee3de24e [#21] ir: Add inner ring list relay processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-02 11:25:35 +03:00

23 lines
620 B
Go

package neofs
import (
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
neofsEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/neofs"
"go.uber.org/zap"
)
// Process update inner ring event by setting inner ring list value from
// main chain in side chain.
func (np *Processor) processUpdateInnerRing(list *neofsEvent.UpdateInnerRing) {
if !np.activeState.IsActive() {
np.log.Info("passive mode, ignore deposit")
return
}
err := invoke.UpdateInnerRing(np.morphClient, np.netmapContract,
list.Keys(),
)
if err != nil {
np.log.Error("can't relay update inner ring event", zap.Error(err))
}
}