@@ -80,15 +80,18 @@ forksAtMostKBlocks k ours theirs = case ours `AF.intersect` theirs of
80
80
-- these fragments intersect with our current chain, they must by transitivity
81
81
-- also intersect each other.
82
82
compareAnchoredFragments ::
83
- forall blk t .
83
+ forall blk t t' .
84
84
( BlockSupportsProtocol blk
85
85
, HasCallStack
86
86
, GetHeader (t blk ) blk
87
87
, HasHeader (t blk )
88
+ , GetHeader (t' blk ) blk
89
+ , HasHeader (t' blk )
90
+ , HeaderHash (t blk ) ~ HeaderHash (t' blk )
88
91
)
89
92
=> BlockConfig blk
90
93
-> AnchoredFragment (t blk )
91
- -> AnchoredFragment (t blk )
94
+ -> AnchoredFragment (t' blk )
92
95
-> Ordering
93
96
compareAnchoredFragments cfg frag1 frag2 =
94
97
assertWithMsg (precondition frag1 frag2) $
@@ -104,12 +107,12 @@ compareAnchoredFragments cfg frag1 frag2 =
104
107
-- fragments represent the same chain and are equally preferable. If
105
108
-- not, the second chain is a strict extension of the first and is
106
109
-- therefore strictly preferable.
107
- if blockPoint tip' == AF. anchorToPoint anchor
110
+ if blockPoint tip' == AF. castPoint ( AF. anchorToPoint anchor)
108
111
then EQ
109
112
else LT
110
113
(_ :> tip, Empty anchor') ->
111
114
-- This case is symmetric to the previous
112
- if blockPoint tip == AF. anchorToPoint anchor'
115
+ if blockPoint tip == AF. castPoint ( AF. anchorToPoint anchor')
113
116
then EQ
114
117
else GT
115
118
(_ :> tip, _ :> tip') ->
0 commit comments