@@ -598,36 +598,36 @@ func (q *EpochQuery) Previous() protocol.Epoch {
598
598
// - (firstHeight, finalHeight, true, true, nil) if epoch is ended
599
599
//
600
600
// 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 ) {
602
602
err = q .snap .state .db .View (func (tx * badger.Txn ) error {
603
603
// Retrieve the epoch's first height
604
604
err = operation .RetrieveEpochFirstHeight (epoch , & firstHeight )(tx )
605
605
if err != nil {
606
606
if errors .Is (err , storage .ErrNotFound ) {
607
- epochStarted = false
608
- epochEnded = false
607
+ isFirstBlockFinalized = false
608
+ isLastBlockFinalized = false
609
609
return nil
610
610
}
611
611
return err // unexpected error
612
612
}
613
- epochStarted = true
613
+ isFirstBlockFinalized = true
614
614
615
615
var subsequentEpochFirstHeight uint64
616
616
err = operation .RetrieveEpochFirstHeight (epoch + 1 , & subsequentEpochFirstHeight )(tx )
617
617
if err != nil {
618
618
if errors .Is (err , storage .ErrNotFound ) {
619
- epochEnded = false
619
+ isLastBlockFinalized = false
620
620
return nil
621
621
}
622
622
return err // unexpected error
623
623
}
624
624
finalHeight = subsequentEpochFirstHeight - 1
625
- epochEnded = true
625
+ isLastBlockFinalized = true
626
626
627
627
return nil
628
628
})
629
629
if err != nil {
630
630
return 0 , 0 , false , false , err
631
631
}
632
- return firstHeight , finalHeight , epochStarted , epochEnded , nil
632
+ return firstHeight , finalHeight , isFirstBlockFinalized , isLastBlockFinalized , nil
633
633
}
0 commit comments