diff --git a/eth/filters/filter.go b/eth/filters/filter.go index 09ccb93907..4a0f68092d 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -287,7 +287,7 @@ func (f *Filter) checkMatches(ctx context.Context, header *types.Header) ([]*typ // such as tx index, block hash, etc. // Notably tx hash is NOT filled in because it needs // access to block body data. - cached, err := f.sys.cachedLogElem(ctx, hash, header.Number.Uint64()) + cached, err := f.sys.cachedLogElem(ctx, hash, header.Number.Uint64(), header.Time) if err != nil { return nil, err } diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index a3a2787a41..e69904c66d 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -96,7 +96,7 @@ type logCacheElem struct { } // cachedLogElem loads block logs from the backend and caches the result. -func (sys *FilterSystem) cachedLogElem(ctx context.Context, blockHash common.Hash, number uint64) (*logCacheElem, error) { +func (sys *FilterSystem) cachedLogElem(ctx context.Context, blockHash common.Hash, number, time uint64) (*logCacheElem, error) { cached, ok := sys.logsCache.Get(blockHash) if ok { return cached, nil @@ -119,6 +119,7 @@ func (sys *FilterSystem) cachedLogElem(ctx context.Context, blockHash common.Has log.BlockNumber = number log.TxIndex = uint(i) log.Index = logIdx + log.BlockTimestamp = time logIdx++ flattened = append(flattened, log) }