From 3b27f4671f5db173ec438776c502cb7bd7cf35eb Mon Sep 17 00:00:00 2001 From: Samuel Stokes Date: Mon, 9 Oct 2023 11:09:25 -0400 Subject: [PATCH] Use GetLastConfirmedBlockNum to set checkForMissedEvents startBlock --- node/engine/chainservice/eth_chainservice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/engine/chainservice/eth_chainservice.go b/node/engine/chainservice/eth_chainservice.go index 7673e2eaa..8d3c6804a 100644 --- a/node/engine/chainservice/eth_chainservice.go +++ b/node/engine/chainservice/eth_chainservice.go @@ -372,11 +372,11 @@ func (ecs *EthChainService) listenForEventLogs(errorChan chan<- error, eventChan return case err := <-ecs.eventSub.Err(): + latestBlockNum := ecs.GetLastConfirmedBlockNum() + ecs.eventTracker.mu.Lock() defer ecs.eventTracker.mu.Unlock() - latestBlockNum := ecs.eventTracker.latestBlockNum - if err != nil { ecs.logger.Warn("error in chain event subscription: " + err.Error()) ecs.eventSub.Unsubscribe()