mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 08:53:46 +00:00
fix: adjust begin
This commit is contained in:
parent
4dae6739f9
commit
9539a72909
1 changed files with 6 additions and 2 deletions
|
|
@ -93,8 +93,12 @@ func (f *BorBlockLogsFilter) Logs(ctx context.Context) ([]*types.Log, error) {
|
||||||
head := header.Number.Uint64()
|
head := header.Number.Uint64()
|
||||||
|
|
||||||
if f.begin == -1 {
|
if f.begin == -1 {
|
||||||
f.begin = int64(nextSprintEnd(head))
|
f.begin = int64(head)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// adjust begin for sprint
|
||||||
|
f.begin = nextSprintEnd(f.begin)
|
||||||
|
|
||||||
end := f.end
|
end := f.end
|
||||||
if f.end == -1 {
|
if f.end == -1 {
|
||||||
end = int64(head)
|
end = int64(head)
|
||||||
|
|
@ -140,7 +144,7 @@ func (f *BorBlockLogsFilter) borBlockLogs(ctx context.Context, receipt *types.Bo
|
||||||
return logs, nil
|
return logs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func nextSprintEnd(n uint64) uint64 {
|
func nextSprintEnd(n int64) int64 {
|
||||||
m := n % 64
|
m := n % 64
|
||||||
if m == 0 {
|
if m == 0 {
|
||||||
return n
|
return n
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue