diff --git a/eth/filters/filter.go b/eth/filters/filter.go index 09ccb9390..eed107d38 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -291,7 +291,7 @@ func (f *Filter) checkMatches(ctx context.Context, header *types.Header) ([]*typ if err != nil { return nil, err } - logs := filterLogs(cached.logs, nil, nil, f.addresses, f.topics) + logs := FilterLogs(cached.logs, nil, nil, f.addresses, f.topics) if len(logs) == 0 { return nil, nil } @@ -313,8 +313,8 @@ func (f *Filter) checkMatches(ctx context.Context, header *types.Header) ([]*typ return logs, nil } -// filterLogs creates a slice of logs matching the given criteria. -func filterLogs(logs []*types.Log, fromBlock, toBlock *big.Int, addresses []common.Address, topics [][]common.Hash) []*types.Log { +// FilterLogs creates a slice of logs matching the given criteria. +func FilterLogs(logs []*types.Log, fromBlock, toBlock *big.Int, addresses []common.Address, topics [][]common.Hash) []*types.Log { var check = func(log *types.Log) bool { if fromBlock != nil && fromBlock.Int64() >= 0 && fromBlock.Uint64() > log.BlockNumber { return false diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 86012b3f9..25189050f 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -376,7 +376,7 @@ func (es *EventSystem) handleLogs(filters filterIndex, ev []*types.Log) { return } for _, f := range filters[LogsSubscription] { - matchedLogs := filterLogs(ev, f.logsCrit.FromBlock, f.logsCrit.ToBlock, f.logsCrit.Addresses, f.logsCrit.Topics) + matchedLogs := FilterLogs(ev, f.logsCrit.FromBlock, f.logsCrit.ToBlock, f.logsCrit.Addresses, f.logsCrit.Topics) if len(matchedLogs) > 0 { f.logs <- matchedLogs }