Skip to content

Commit 38284e6

Browse files
author
Naohiro Yoshida
committed
check
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
1 parent b7c1a28 commit 38284e6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

module/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func withTrustedHeight(targetHeaders []core.Header, clientStateLatestHeight expo
144144
func makeSubmittingHeights(latestFinalizedHeight uint64, savedLatestHeight uint64, firstUnsaved uint64, nextForkBoundaryTs *uint64, nextForkBoundaryHeightMinus1 uint64) []uint64 {
145145
var submittingHeights []uint64
146146
if latestFinalizedHeight < firstUnsaved {
147-
if nextForkBoundaryTs != nil && nextForkBoundaryHeightMinus1 < latestFinalizedHeight {
147+
if nextForkBoundaryTs != nil && savedLatestHeight < nextForkBoundaryHeightMinus1 && nextForkBoundaryHeightMinus1 < latestFinalizedHeight {
148148
submittingHeights = append(submittingHeights, nextForkBoundaryHeightMinus1)
149149
}
150150
} else {

module/setup_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ func (ts *SetupTestSuite) Test_makeSubmittingHeights() {
231231
rq.Len(makeSubmittingHeights(10, 1, 11, nil, 0), 0)
232232
rq.Len(makeSubmittingHeights(10, 1, 11, &msec, 11), 0)
233233
rq.Len(makeSubmittingHeights(10, 1, 11, &msec, 9), 1)
234+
rq.Len(makeSubmittingHeights(10, 9, 11, &msec, 9), 0)
234235
rq.Equal(
235236
[]uint64{99, 100, 200, 300, 400, 500},
236237
makeSubmittingHeights(501, 0, 100, &msec, 99),

0 commit comments

Comments
 (0)