[#1291] innerring: Don't stop the same listener twice

When IR node configured without main chain, both
`morphListener` and `mainnetListener` are pointing
into single listener component. We should not call
`Stop()` twice, because it may trigger channel
closing in neo-go or other components and it
can throw panic.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2022-03-15 14:32:25 +03:00 committed by Alex Vanin
parent d311585de6
commit 77f4a5844b

View file

@ -282,7 +282,9 @@ func (s *Server) Stop() {
s.setHealthStatus(control.HealthStatus_SHUTTING_DOWN)
go s.morphListener.Stop()
if !s.withoutMainNet {
go s.mainnetListener.Stop()
}
for _, c := range s.closers {
if err := c(); err != nil {