Skip to content

Commit

Permalink
Mark filter stale for Besu nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Nicko Guyer <nicko.guyer@kaleido.io>
  • Loading branch information
nguyer committed Nov 7, 2023
1 parent 5fee4d0 commit 64c391b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/events/block_confirmations.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (bcm *blockConfirmationManager) pollBlockFilter() ([]*ethbinding.Hash, erro
defer cancel()
var blockHashes []*ethbinding.Hash
if err := bcm.rpc.CallContext(ctx, &blockHashes, "eth_getFilterChanges", bcm.filterID); err != nil {
if strings.Contains(err.Error(), "filter not found") {
if strings.Contains(strings.ToLower(err.Error()), "filter not found") {
bcm.filterStale = true
}
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion internal/events/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func (s *subscription) processNewEvents(ctx context.Context) error {
s.info.Synchronized = true
}
if err := s.rpc.CallContext(ctx, &logs, rpcMethod, s.filterID); err != nil {
if strings.Contains(err.Error(), "filter not found") {
if strings.Contains(strings.ToLower(err.Error()), "filter not found") {
s.markFilterStale(ctx, true)
}
return err
Expand Down

0 comments on commit 64c391b

Please sign in to comment.