exclude reverted events from results returned by eth_getLogs
This commit is contained in:
parent
0787ff3bc3
commit
03419034c2
@ -388,7 +388,7 @@ func (m *EventFilterManager) Install(ctx context.Context, minHeight, maxHeight a
|
|||||||
|
|
||||||
if m.EventIndex != nil && minHeight != -1 && minHeight < currentHeight {
|
if m.EventIndex != nil && minHeight != -1 && minHeight < currentHeight {
|
||||||
// Filter needs historic events
|
// Filter needs historic events
|
||||||
if err := m.EventIndex.PrefillFilter(ctx, f); err != nil {
|
if err := m.EventIndex.PrefillFilter(ctx, f, true); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ func (ei *EventIndex) CollectEvents(ctx context.Context, te *TipSetEvents, rever
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PrefillFilter fills a filter's collection of events from the historic index
|
// PrefillFilter fills a filter's collection of events from the historic index
|
||||||
func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
|
func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter, excludeReverted bool) error {
|
||||||
clauses := []string{}
|
clauses := []string{}
|
||||||
values := []any{}
|
values := []any{}
|
||||||
joins := []string{}
|
joins := []string{}
|
||||||
@ -500,6 +500,11 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if excludeReverted {
|
||||||
|
clauses = append(clauses, "event.reverted=?")
|
||||||
|
values = append(values, false)
|
||||||
|
}
|
||||||
|
|
||||||
if len(f.addresses) > 0 {
|
if len(f.addresses) > 0 {
|
||||||
subclauses := []string{}
|
subclauses := []string{}
|
||||||
for _, addr := range f.addresses {
|
for _, addr := range f.addresses {
|
||||||
|
Loading…
Reference in New Issue
Block a user