Skip to content

Commit f0b14fc

Browse files
committed
rename bool returns in retrieveEpochHeightBounds
1 parent 04fb748 commit f0b14fc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

state/protocol/badger/snapshot.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -598,36 +598,36 @@ func (q *EpochQuery) Previous() protocol.Epoch {
598598
// - (firstHeight, finalHeight, true, true, nil) if epoch is ended
599599
//
600600
// No errors are expected during normal operation.
601-
func (q *EpochQuery) retrieveEpochHeightBounds(epoch uint64) (firstHeight, finalHeight uint64, epochStarted, epochEnded bool, err error) {
601+
func (q *EpochQuery) retrieveEpochHeightBounds(epoch uint64) (firstHeight, finalHeight uint64, isFirstBlockFinalized, isLastBlockFinalized bool, err error) {
602602
err = q.snap.state.db.View(func(tx *badger.Txn) error {
603603
// Retrieve the epoch's first height
604604
err = operation.RetrieveEpochFirstHeight(epoch, &firstHeight)(tx)
605605
if err != nil {
606606
if errors.Is(err, storage.ErrNotFound) {
607-
epochStarted = false
608-
epochEnded = false
607+
isFirstBlockFinalized = false
608+
isLastBlockFinalized = false
609609
return nil
610610
}
611611
return err // unexpected error
612612
}
613-
epochStarted = true
613+
isFirstBlockFinalized = true
614614

615615
var subsequentEpochFirstHeight uint64
616616
err = operation.RetrieveEpochFirstHeight(epoch+1, &subsequentEpochFirstHeight)(tx)
617617
if err != nil {
618618
if errors.Is(err, storage.ErrNotFound) {
619-
epochEnded = false
619+
isLastBlockFinalized = false
620620
return nil
621621
}
622622
return err // unexpected error
623623
}
624624
finalHeight = subsequentEpochFirstHeight - 1
625-
epochEnded = true
625+
isLastBlockFinalized = true
626626

627627
return nil
628628
})
629629
if err != nil {
630630
return 0, 0, false, false, err
631631
}
632-
return firstHeight, finalHeight, epochStarted, epochEnded, nil
632+
return firstHeight, finalHeight, isFirstBlockFinalized, isLastBlockFinalized, nil
633633
}

0 commit comments

Comments
 (0)