mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 18:00:46 +00:00
simplify code
This commit is contained in:
parent
796ee818e3
commit
aa84249c0d
1 changed files with 1 additions and 1 deletions
|
|
@ -468,7 +468,7 @@ func (api *API) getRewardFileNamesInRange(begin, end *rpc.BlockNumber) ([]reward
|
||||||
startIndex := sort.SearchInts(epochNumbers, int(beginHeader.Number.Int64()))
|
startIndex := sort.SearchInts(epochNumbers, int(beginHeader.Number.Int64()))
|
||||||
endIndex := sort.SearchInts(epochNumbers, int(endHeader.Number.Int64()))
|
endIndex := sort.SearchInts(epochNumbers, int(endHeader.Number.Int64()))
|
||||||
if endIndex == len(epochNumbers) {
|
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
|
var rewardfileNamesInRange []rewardFileName
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue