Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 committed Aug 21, 2024
1 parent 78cb3fe commit 1eeb66d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protocol/daemons/liquidation/client/sub_task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func (s *SubTaskRunnerImpl) RunLiquidationDaemonTaskLoop(
return err
}

// Skip the loop if no new block has been committed.
// Note that lastLoopBlockHeight is initialized to 0, so the first loop will always run.
if lastCommittedBlockHeight == s.lastLoopBlockHeight {
daemonClient.logger.Info(
"Skipping liquidation daemon task loop as no new block has been committed",
Expand All @@ -60,6 +62,7 @@ func (s *SubTaskRunnerImpl) RunLiquidationDaemonTaskLoop(
return nil
}

// Update the last loop block height.
s.lastLoopBlockHeight = lastCommittedBlockHeight

// 1. Fetch all information needed to calculate total net collateral and margin requirements.
Expand Down

0 comments on commit 1eeb66d

Please sign in to comment.