From 6c574dfbf7d67fbe550c746cf1c65e6ca74e8489 Mon Sep 17 00:00:00 2001 From: Lauri Junkkari Date: Thu, 2 Sep 2021 12:34:22 +0300 Subject: [PATCH] Clean up --- chain_events/listener.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/chain_events/listener.go b/chain_events/listener.go index b9659708..a88aaea1 100644 --- a/chain_events/listener.go +++ b/chain_events/listener.go @@ -95,11 +95,10 @@ func (l *Listener) Start() *Listener { if err := l.initHeight(); err != nil { _, ok := err.(*LockError) - if ok { - // Skip LockError as it means another listener is already handling this - } else { + if !ok { panic(err) } + // Skip LockError as it means another listener is already handling this } // TODO (latenssi): should use random intervals instead @@ -134,11 +133,10 @@ func (l *Listener) Start() *Listener { if lockErr != nil { _, ok := lockErr.(*LockError) - if ok { - // Skip on LockError as it means another listener is already handling this round - continue + if !ok { + l.handleError(lockErr) } - l.handleError(lockErr) + // Skip on LockError as it means another listener is already handling this round } } }