forked from TrueCloudLab/frostfs-node
[#324] ir: Register block handler before starting the listening routine
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
44c899b560
commit
abc7885056
1 changed files with 3 additions and 3 deletions
|
@ -118,9 +118,6 @@ func (s *Server) Start(ctx context.Context, intError chan<- error) error {
|
|||
}
|
||||
}()
|
||||
|
||||
go s.morphListener.ListenWithError(ctx, morphErr) // listen for neo:morph events
|
||||
go s.mainnetListener.ListenWithError(ctx, mainnnetErr) // listen for neo:mainnet events
|
||||
|
||||
s.morphListener.RegisterBlockHandler(func(b *block.Block) {
|
||||
s.log.Debug("new block",
|
||||
zap.Uint32("index", b.Index),
|
||||
|
@ -129,6 +126,9 @@ func (s *Server) Start(ctx context.Context, intError chan<- error) error {
|
|||
s.tickTimers()
|
||||
})
|
||||
|
||||
go s.morphListener.ListenWithError(ctx, morphErr) // listen for neo:morph events
|
||||
go s.mainnetListener.ListenWithError(ctx, mainnnetErr) // listen for neo:mainnet events
|
||||
|
||||
if err := s.startBlockTimers(); err != nil {
|
||||
return errors.Wrap(err, "could not start block timers")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue