Skip to content

Commit

Permalink
Simplify GDD Governor loop
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed May 6, 2024
1 parent 8e754a4 commit 0808e84
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ runGdd loEUpdater varLoEFrag chainDb getTrigger =
curLedger <- ChainDB.getCurrentLedger chainDb
pure (newTrigger, curChain, curLedger)
loeFrag <- updateLoEFrag loEUpdater curChain curLedger
oldLoEFrag <- atomically $
readTVar varLoEFrag <* writeTVar varLoEFrag loeFrag
oldLoEFrag <- atomically $ swapTVar varLoEFrag loeFrag
-- The chain selection only depends on the LoE tip, so there
-- is no point in retriggering it if the LoE tip hasn't changed.
when (AF.headHash oldLoEFrag /= AF.headHash loeFrag) $
Expand Down

0 comments on commit 0808e84

Please sign in to comment.