Skip to content

Commit

Permalink
Simplify chainDiffs computation in chainSelectionForBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed May 3, 2024
1 parent 3a7e4d4 commit 1c0ab60
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,9 @@ chainSelectionForBlock cdb@CDB{..} blockCache hdr punish = electric $ do
return $ AF.fromOldestFirst curHead (hdr : hdrs)

let chainDiffs = NE.nonEmpty
$ NE.filter ( preferAnchoredCandidate (bcfg chainSelEnv) curChain
. Diff.getSuffix
)
$ fmap Diff.extend candidates
$ map Diff.extend
$ NE.filter (preferAnchoredCandidate (bcfg chainSelEnv) curChain)
candidates
-- All candidates are longer than the current chain, so they will be
-- preferred over it, /unless/ the block we just added is an EBB,
-- which has the same 'BlockNo' as the block before it, so when
Expand Down

0 comments on commit 1c0ab60

Please sign in to comment.