[#873] innerring/notary: Change notary deposit logic

IR tries to keep 1:3 proportion of GAS and
notary balances respectively. If that proportion
has been messed(means that notary balance is
lower than required) it sends half of its
GAS balance to the notary service.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-10-11 20:09:52 +03:00 committed by Alex Vanin
parent a25bd2112d
commit e5748bfc96
5 changed files with 58 additions and 11 deletions

View file

@ -31,6 +31,17 @@ func (s *Server) SetEpochCounter(val uint64) {
s.epochCounter.Store(val)
}
// EpochDuration is a getter for a global epoch duration.
func (s *Server) EpochDuration() uint64 {
return s.epochDuration.Load()
}
// SetEpochDuration is a setter for the Netmap processor to update global
// epoch duration.
func (s *Server) SetEpochDuration(val uint64) {
s.epochDuration.Store(val)
}
// IsActive is a getter for a global active flag state.
func (s *Server) IsActive() bool {
return s.InnerRingIndex() >= 0