Skip to content

Commit

Permalink
fix: update poller Stop for TestFastSync
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterli committed Sep 24, 2024
1 parent 16e3318 commit 3f3464a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions finality-provider/service/chain_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit 3f3464a

Please sign in to comment.