Skip to content

Commit

Permalink
fix(events): check for sync-in-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Apr 26, 2024
1 parent 1a789d3 commit 59b166b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chain/events/filter/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ func (m *EventFilterManager) Install(ctx context.Context, minHeight, maxHeight a
currentHeight := m.currentHeight
m.mu.Unlock()

if currentHeight == 0 {
return nil, xerrors.Errorf("sync in progress, cannot install event filter")
}

if m.EventIndex == nil && minHeight != -1 && minHeight < currentHeight {
return nil, xerrors.Errorf("historic event index disabled")
}
Expand Down

0 comments on commit 59b166b

Please sign in to comment.