mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 17:03:46 +00:00
cmd/workload: fix diagnostics
This commit is contained in:
parent
33ec53c417
commit
c35849552c
1 changed files with 2 additions and 5 deletions
|
|
@ -180,10 +180,7 @@ func (s *filterTestGen) extendRange(q *filterQuery) *filterQuery {
|
||||||
if rangeLen+extLen > s.finalizedBlock {
|
if rangeLen+extLen > s.finalizedBlock {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
extBefore := rand.Int63n(extLen + 1)
|
extBefore := min(rand.Int63n(extLen+1), q.FromBlock)
|
||||||
if extBefore > q.FromBlock {
|
|
||||||
extBefore = q.FromBlock
|
|
||||||
}
|
|
||||||
extAfter := extLen - extBefore
|
extAfter := extLen - extBefore
|
||||||
if q.ToBlock+extAfter > s.finalizedBlock {
|
if q.ToBlock+extAfter > s.finalizedBlock {
|
||||||
d := q.ToBlock + extAfter - s.finalizedBlock
|
d := q.ToBlock + extAfter - s.finalizedBlock
|
||||||
|
|
@ -337,7 +334,7 @@ func (s *filterTestGen) newNarrowedQuery() *filterQuery {
|
||||||
pick--
|
pick--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic(nil)
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
|
|
||||||
// randomQuery returns a random query from the ones that were already generated.
|
// randomQuery returns a random query from the ones that were already generated.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue