simplify code

This commit is contained in:
Wanwiset Peerapatanapokin 2025-06-16 13:53:34 +04:00 committed by GitHub
parent 796ee818e3
commit aa84249c0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -468,7 +468,7 @@ func (api *API) getRewardFileNamesInRange(begin, end *rpc.BlockNumber) ([]reward
startIndex := sort.SearchInts(epochNumbers, int(beginHeader.Number.Int64()))
endIndex := sort.SearchInts(epochNumbers, int(endHeader.Number.Int64()))
if endIndex == len(epochNumbers) {
endIndex = endIndex - 1 //this is to prevent endIndex out of bounds when endInput is higher than last reward(epoch) block but lower than latest block
endIndex-- //this is to prevent endIndex out of bounds when endInput is higher than last reward(epoch) block but lower than latest block
}
var rewardfileNamesInRange []rewardFileName