Skip to content

Commit

Permalink
Add: Explanatory comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
nc6 committed Jul 11, 2019
1 parent cbb75bb commit ce5a642
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ouroboros-network/src/Ouroboros/Network/AnchoredFragment.hs
Expand Up @@ -209,6 +209,9 @@ validExtension af bSucc =
blockInvariant bSucc &&
case head af of
Left p -> pointHash p == blockPrevHash bSucc &&
-- Note that this inequality would be strict, but for epoch
-- boundary blocks, which occupy the same slot as a regular
-- block.
pointSlot p <= blockSlot bSucc
Right b -> bSucc `CF.isValidSuccessorOf` b

Expand Down
3 changes: 3 additions & 0 deletions ouroboros-network/src/Ouroboros/Network/ChainFragment.hs
Expand Up @@ -227,6 +227,9 @@ isValidSuccessorOf' bSucc b
, ") at "
, prettyCallStack callStack
]
-- Note that this inequality would be loose, but for epoch
-- boundary blocks, which occupy the same slot as a regular
-- block.
| pointSlot p > blockSlot bSucc
= Left $ concat [
"Slot of tip ("
Expand Down

0 comments on commit ce5a642

Please sign in to comment.