[#355] innerring: Refactor block timer constructors

This small refactoring adds `blocktimer.go` file with
all timer related function and constructors. This way
we can create all timers in one place (at the end of
innerring.Server constructor).

To do that we had to move timer reset into global
server state so it can be accessed by netmap
processor.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-01-29 10:42:40 +03:00 committed by Alex Vanin
parent 402192c8c4
commit 6848a816f9
5 changed files with 106 additions and 68 deletions

View file

@ -83,3 +83,10 @@ func (s *Server) WriteReport(r *audit.Report) error {
return s.auditClient.PutAuditResult(res)
}
// ResetEpochTimer resets block timer that produces events to update epoch
// counter in netmap contract. Used to synchronize this even production
// based on block with notification of last epoch.
func (s *Server) ResetEpochTimer() error {
return s.epochTimer.Reset()
}