mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +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()
|
||||
|
||||
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
|
||||
if f.end == -1 {
|
||||
end = int64(head)
|
||||
|
|
@ -140,7 +144,7 @@ func (f *BorBlockLogsFilter) borBlockLogs(ctx context.Context, receipt *types.Bo
|
|||
return logs, nil
|
||||
}
|
||||
|
||||
func nextSprintEnd(n uint64) uint64 {
|
||||
func nextSprintEnd(n int64) int64 {
|
||||
m := n % 64
|
||||
if m == 0 {
|
||||
return n
|
||||
|
|
|
|||
Loading…
Reference in a new issue