From 3f3464a8fa1915e60b1cd2bcd82000b631f791e0 Mon Sep 17 00:00:00 2001 From: lesterli Date: Tue, 24 Sep 2024 21:04:12 +0800 Subject: [PATCH] fix: update poller Stop for TestFastSync --- finality-provider/service/chain_poller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/finality-provider/service/chain_poller.go b/finality-provider/service/chain_poller.go index ea6e70be..4fe2d6df 100644 --- a/finality-provider/service/chain_poller.go +++ b/finality-provider/service/chain_poller.go @@ -74,8 +74,7 @@ func NewChainPoller( func (cp *ChainPoller) Start(startHeight uint64) error { if cp.isStarted.Swap(true) { - cp.logger.Info("the poller is already started") - return nil + return fmt.Errorf("the poller is already started") } cp.logger.Info("starting the chain poller") @@ -99,7 +98,8 @@ func (cp *ChainPoller) Start(startHeight uint64) error { func (cp *ChainPoller) Stop() error { if !cp.isStarted.Swap(false) { - return fmt.Errorf("the chain poller has already stopped") + cp.logger.Info("the chain poller has already stopped") + return nil } cp.logger.Info("stopping the chain poller")