[#910] innerring: Make notary deposit on notification instead of timer

Timer is not suitable for notary deposits because it can never fire
in case of desynchronization or external epoch changes. Notary deposits
must be handled on new epoch event.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-11-01 18:55:25 +03:00 committed by Alex Vanin
parent 45f244eb77
commit a437ffc3ed
6 changed files with 35 additions and 38 deletions

View file

@ -50,12 +50,6 @@ type (
depositor func() (util.Uint256, error)
awaiter func(context.Context, util.Uint256) error
notaryDepositArgs struct {
l *zap.Logger
depositor depositor
}
)
func (s *Server) addBlockTimer(t *timer.BlockTimer) {
@ -148,13 +142,3 @@ func newEmissionTimer(args *emitTimerArgs) *timer.BlockTimer {
},
)
}
func newNotaryDepositHandler(args *notaryDepositArgs) newEpochHandler {
return func() {
_, err := args.depositor()
if err != nil {
args.l.Warn("can't deposit notary contract",
zap.String("error", err.Error()))
}
}
}