Skip to content

Commit 21a254a

Browse files
authored
Merge pull request #776 from rocket-pool/fix-find-approximator-first-interval
Fix to find the apporximator for the first interval
2 parents 33064c0 + 2e8bd5e commit 21a254a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

shared/services/rewards/generator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ func NewTreeGenerator(logger *log.ColorLogger, logPrefix string, rp RewardsExecu
186186
})
187187

188188
// The first ruleset whose startInterval is at most t.index is the one to use
189-
// for treegen, and for some reason, the first ruleset whose start interval is less than t.index
190-
// is the one to use for approximations
191189
for _, info := range rewardsIntervalInfos {
192190

193191
startInterval, err := info.GetStartInterval(network)
@@ -198,7 +196,7 @@ func NewTreeGenerator(logger *log.ColorLogger, logPrefix string, rp RewardsExecu
198196
t.generatorImpl = info.generator
199197
foundGenerator = true
200198
}
201-
if !foundApproximator && startInterval < t.index {
199+
if !foundApproximator && startInterval <= t.index {
202200
t.approximatorImpl = info.generator
203201
foundApproximator = true
204202
}

0 commit comments

Comments
 (0)